sbt-docker-compose
sbt-docker-compose copied to clipboard
Ability to rebuild and restart individual container, rather than entire stack
If I have a complex docker-compose.yml
with a lot of services, it's a bit slow to have to run sbt dockerComposeStop dockerComposeUp
every time I make a code change and want to update the container. I really want a command to just rebuild and restart the individual container corresponding to the project I'm working on, and not all the other services. e.g. something similar to docker-compose up -d --no-deps --build my-service
. Is it possible to add support for this to sbt-docker-compose?
Also, what's the best way to use sbt-docker-compose with IntelliJ run configurations? Ideally I'd like a run configuration which just reloads an individual service/container if sbt dockerComposeUp
has already been ran!
@joshfg We have been experimenting this feature already in our internal projects and I can personally tells you that it works pretty much as you described. Not only will it restart your built containers, but it will also restart any other dependent containers in your composed instances. For example, if you added a bunch of test data in your mysql DB and don't want to do a mass undo, you can simply restart the mysql container. I'll try to find time to port this feature to this repo.
Perhaps @kurtkopchik can help you with the second part of your question as I personally haven't used sbt-docker-compose in IntelliJ.
Thanks @yiming-li-tapad, that feature sounds great! It's been my only issue with the plugin, as it just seems inefficient to have to wait for compose to restart all containers, when only one has changed. Looking forward to trying it out!
Any ideas on this issue? It seems to be very useful.