3 ms·
I think `docker-compose down <service> && docker-compose up -d --force-recreate <service>` should do it.
by bingo-bongo 5y ago
I think `docker-compose down <service> && docker-compose up -d --force-recreate <service>` should do it.
- wfleming 5y agoThanks for pointing out `--force-recreate`: I'm pretty sure that didn't exist when I started using `docker-compose`. That reduces my common usage from 3 commands to 2 :). As a point of minor interest I also avoid `down` vs `stop` because `down` can remove volumes. Reading the `--help` now (I'm not about to actually try it for reasons that will be clear shortly), it appears that's not the default behavior, but I'm pretty sure it was at one point. I `docker-compose down`-ed once and wiped out my local databases and that was an unpleasant morning, and ever since I've avoided it. That's a round-a-about way of explaining that a certain amount of my programming habits are certainly born of having stepped on numerous rakes in the past, but some of those rakes don't really exist anymore and I don't always notice when they go away. So I appreciate you prompting me to re-examine this particular habit as being out of date.
- remram 5y agoUnfortunately `docker-compose down` takes no argument. You have to do `docker-compose rm -sf <service>`