-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add simple restart
action (without sync) to Compose Watch for use with bind mounts
#11446
Comments
Why not use |
We have a single image for local development that has Node/PHP/Python/etc. installed and doesn't contain any app data. We use that image + We're quite happy with our setup. All of the recent communication from Docker has been about making the local development experience better. Shouldn't that include supporting how different teams work rather than trying to switch everyone from bind mounts to sync? I don't really understand the downside of adding a standalone |
My question is not to reject this feature request, but to better understand which use-cases this would cover, and the benefits for our users. |
Ah ok, sorry. I misunderstood. Hopefully my description explains our use case. |
I agree with @binaryfire that this would be really helpful. I stumbled across the same issue a few weeks back and would really like to have an option where I can simply restart the command specified in the docker-compose.yml if a mounted file in a given directory changes. I am currently using multiple docker images that run some Python scripts which are bind-mounted and the sync+restart takes quite some time which could be avoided that way |
@ndeloof We have this case: sync+restart do not work as expected with docker secrets because they are bound under the root user, but the process can be launched from another user (I haven’t found a way to bypass this) |
+1 I'd also love to see this implemented @ndeloof. Watch is awesome as it is and That being said, being able to just
Hope this lands soon! And again, thanks for your efforts on this front, it's definitely a pain shared by everyone running compose for development and you were spot on identifying and addressing this. Cheers! |
👋 hey @ndeloof thanks for #12375 ! It works like a charm. We should update the docs at https://docs.docker.com/compose/how-tos/file-watch/ to include Here's the python config I'm using, just as an example of a typical " develop:
watch:
- action: restart
path: ./src
- action: rebuild
path: dependencies.txt Hope this helps, and thanks again for this feature, I'm already loving it (prior to this I was contemplating installing Cheers! |
Hi guys
We use bind mounts for local development, and there are still times when you need to restart the container on file changes. Laravel's queue workers are a good example - they need to be restarted to pick up on changes and there's no simple way to automate that without a package and some custom code.
Currently there's no Compose Watch action that covers this scenario.
sync+restart
expects a target that it can sync files to. Would it be possible to add a simplerestart
action that can just watch files at a given path and restart the container if anything changes? This would make our (and I'm sure many other people's) lives much easier. I'm assuming this would be pretty easy to add: the functionality is there, it's just currently always coupled to a sync?PS. This has been requested before here: #11062 (comment)
The text was updated successfully, but these errors were encountered: