How to quickly upgrade a docker storage container

How do you quickly upgrade a single running service using docker-compose.

I often press docker-compose stop SERVICE , docker-compose build SERVICE and docker-compose up -d SERVICE .

Is there an easier way, preferably with a short downtime.

+6
source share
2 answers

In a dev environment, I would suggest you create a volume mapped to your source tree and set up a hot reboot.

For production, there is an article offering the following command:

 docker-compose -f docker-compose.prod.yml up --build --no-deps -d SERVICE 
+5
source

If you need to restart it to change the code, you can try using volume .

Otherwise, the commands that you run are the most effective. If stop takes 10 seconds, see https://docs.docker.com/compose/faq/#why-do-my-services-take-10-seconds-to-stop or consider using docker-compose kill SERVICE for forced stop.

0
source

All Articles