docker compose down
Stops and removes the containers and networks a Compose project created.
In more detail
Volumes are kept unless you add -v (or --volumes), which also deletes named volumes and all their data. In tests, docker compose down -v gives every run a clean start; in development, leave -v off to keep your database.
Example
docker compose down -vRelated terms
- Docker Compose — A Docker tool that starts several related containers together from one YAML file.
- volume — Storage managed by Docker that lives outside any container, so data survives when the container is removed.
- integration test — A test that checks several real parts working together, such as the service talking to a real database.
Taught in
- Define The Service And Database With Compose — Docker Architecture & Production Containers
- Health Checks, Dependencies And Reliable Startup — Docker Architecture & Production Containers
- Development Overrides, Hot Reloading And Debuggers — Docker Architecture & Production Containers
- Integration Tests, Test Data And Compose Cleanup — Docker Architecture & Production Containers