{"id":15505051,"url":"https://github.com/remorses/compose-watcher","last_synced_at":"2025-04-23T01:23:46.752Z","repository":{"id":62564247,"uuid":"247254017","full_name":"remorses/compose-watcher","owner":"remorses","description":"Watch volumes and restart services in docker compose","archived":false,"fork":false,"pushed_at":"2020-03-19T14:51:52.000Z","size":216,"stargazers_count":25,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-02T02:10:14.577Z","etag":null,"topics":["devtools","docker","docker-compose","nodejs","python","typescript","watch","watcher"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remorses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-14T10:16:11.000Z","updated_at":"2024-01-22T12:29:06.000Z","dependencies_parsed_at":"2022-11-03T16:00:36.381Z","dependency_job_id":null,"html_url":"https://github.com/remorses/compose-watcher","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":"remorses/python-lib-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorses%2Fcompose-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorses%2Fcompose-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorses%2Fcompose-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remorses%2Fcompose-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remorses","download_url":"https://codeload.github.com/remorses/compose-watcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250350003,"owners_count":21416049,"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","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":["devtools","docker","docker-compose","nodejs","python","typescript","watch","watcher"],"created_at":"2024-10-02T09:21:03.094Z","updated_at":"2025-04-23T01:23:46.724Z","avatar_url":"https://github.com/remorses.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compose-watcher\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src='https://raw.githubusercontent.com/remorses/compose-watcher/master/.github/compose_watcher_video.gif'\u003e\n\u003c/p\u003e\n\nCli that restarts you docker compose services when a file inside one of its volumes changes.\n\nUseful for faster developement with containers that expose behaviour based on mounted files.\n\nExample usage\n\n-   graphql api restart when schema file changes\n-   graphql api mocks based on schema file ([like this one](https://github.com/remorses/graphql-easy-mocks))\n-   Every container that generates code and exposes a server based on a config file\n-   Nodejs container restarts when the src folder changes, recompiling with tsc\n-   [Mongoke](https://github.com/remorses/mongoke) restarts when config schema changes\n\n## Install\n\n```sh\npip3 install compose-watcher\n# then you can watch for changes\ncompose-watcher -f docker-compose.yml\n```\n\n## Usage\n\nUse the directories you want to track as service volumes.\n\nAlso consider using `init: true` in the compose service definition for faster killing of processes.\n\nTo not stop the `docker-compose` commands on other terminals there should be always a running container (this is a strange fact about docker-compose).\n\n```\nversion: '3'\n\nservices:\n  api:\n    build: .\n    command: sh -c 'tsc --incremental \u0026\u0026 node index.js'\n    volumes:\n      - ./src:/src\n\n```\n\nThen execute `compose-watcher` to watch changes.\n\n```sh\ncompose-watcher -f docker-compose.yml --timeout 5\n```\n\nTODO add extension filter\n\n## How it works\n\nAfter running the `compose-watcher` command all the volumes mounted on every service are tracked for change, when a change happens the service where the volume is mounted is restarted toghether with the services in the `depends_on` filed. Then the other services that have the restarted service as a dependency in `depends_on` are restarted too.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremorses%2Fcompose-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremorses%2Fcompose-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremorses%2Fcompose-watcher/lists"}