Wood Chen

How to Stop and Redeploy Services Deployed with Docker Compose

0 comments701 views107 words

This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文

To stop and redeploy services deployed with Docker Compose, follow these steps:

  1. Stop services

To stop services, run the following command:

docker-compose stop

This stops all running containers without removing them.

  1. Restart services

To restart services, run the following command:

docker-compose start

This starts all stopped containers.

  1. Redeploy services

To redeploy services, run the following command:

docker-compose up --force-recreate --build

This forces all containers to be recreated and rebuilt, then starts them. Note that this may cause data loss, so use it with caution.

  1. Remove services

To remove services, run the following command:

docker-compose down

This stops and removes all running containers and removes all associated networks and volumes.

For more information, see the Docker Compose documentation.

Last updated 2024-01-14

Related posts

Comments 0