{"id":13640013,"url":"https://github.com/anki-code/docker-xonsh-wrapper","last_synced_at":"2025-10-28T05:04:59.064Z","repository":{"id":103638853,"uuid":"299589692","full_name":"anki-code/docker-xonsh-wrapper","owner":"anki-code","description":"Wrap an app in docker container and catch the signals from docker using xonsh shell. ","archived":false,"fork":false,"pushed_at":"2022-12-21T14:11:37.000Z","size":26,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T09:34:52.443Z","etag":null,"topics":["docker","xonsh","xonsh-dev","xontrib"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anki-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"custom":["https://github.com/anki-code","https://www.buymeacoffee.com/xxh","https://github.com/xonsh/xonsh#the-xonsh-shell-community"]}},"created_at":"2020-09-29T11:01:12.000Z","updated_at":"2024-08-08T07:22:59.000Z","dependencies_parsed_at":"2023-05-24T04:00:19.041Z","dependency_job_id":null,"html_url":"https://github.com/anki-code/docker-xonsh-wrapper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anki-code/docker-xonsh-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fdocker-xonsh-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fdocker-xonsh-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fdocker-xonsh-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fdocker-xonsh-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anki-code","download_url":"https://codeload.github.com/anki-code/docker-xonsh-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anki-code%2Fdocker-xonsh-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281386589,"owners_count":26492014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","xonsh","xonsh-dev","xontrib"],"created_at":"2024-08-02T01:01:07.013Z","updated_at":"2025-10-28T05:04:59.033Z","avatar_url":"https://github.com/anki-code.png","language":"Python","funding_links":["https://github.com/anki-code","https://www.buymeacoffee.com/xxh","https://github.com/xonsh/xonsh#the-xonsh-shell-community"],"categories":["See also"],"sub_categories":["pytest: xonsh not found"],"readme":"**docker-xonsh-wrapper** shows the way to wrap an app (e.g. server) in docker container using [xonsh shell](https://xon.sh/contents.html) to:\n * catching the signals from docker (SIGTERM, SIGINT, SIGHUP)\n * doing work before starting the app\n * doing work after stopping the app\n\nTo achieve this install xonsh in the container and use `run.xsh` as an entrypoint.\n\nIf you like the idea of xxh click ⭐ on the repo and stay tuned.\n\n## Build and run the demo container\n\n```shell script\ngit clone https://github.com/anki-code/docker-xonsh-wrapper\ncd xonsh-docker-wrapper\ndocker build . -t local/docker-xonsh-wrapper\ndocker run --rm -it local/docker-xonsh-wrapper\n```\n\n## Example\n```shell script\ndocker run --rm -it local/docker-xonsh-wrapper\n# [Work before running the app]\n# The app just sleep 2 minutes zZzZzZz...\n#\n#                 # Run docker stop, docker restart or press Ctrl+C\n#\n# CATCH: signum=15, stopping the process...            \n#\n#                 # After getting closing signal the app could take time \n#                 # to stopping (closing the database, clean the memory) \n#                 # and we're waiting the ending before doing final work.\n#\n# [Work after running the app or getting stop signals]\n```\n\n## Related links\n* Real life example - [metabase-sql-wrapper](https://github.com/anki-code/metabase-sql-wrapper)\n* [Trapping signal from “docker stop” in bash](https://stackoverflow.com/questions/20602675/trapping-signal-from-docker-stop-in-bash/20606897#20606897)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-code%2Fdocker-xonsh-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanki-code%2Fdocker-xonsh-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanki-code%2Fdocker-xonsh-wrapper/lists"}