How to Stop and Redeploy Services Deployed with Docker Compose
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:
- Stop services
To stop services, run the following command:
docker-compose stop
This stops all running containers without removing them.
- Restart services
To restart services, run the following command:
docker-compose start
This starts all stopped containers.
- 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.
- 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
Comments 0