Lesson 19 / 26
compose up / down
Start and stop the whole stack with two commands.
up and down
up -d builds (if needed) and starts every service in the background. down stops and removes the containers and network — add -v to also remove volumes.
docker compose up -d
docker compose logs -f app
docker compose down
docker compose down -v # also remove named volumesQuick check: What does `docker compose down -v` do differently from a plain `docker compose down`?
- It also removes named volumes
- It runs in verbose mode
- It only stops, doesn't remove containers
Answer
It also removes named volumes — The -v flag additionally deletes named volumes declared in the compose file, wiping persisted data.