Docker Compose Tip #76: docker compose down and its options

docker compose down looks like a tidy shutdown command. It is, but the flags around it decide whether you walk away with your data intact, with a clean image store, or with a database wiped because you typed -v out of habit. The default behavior Without any flag, down stops and removes: Every container in the project The default network Compose created for the project Anonymous volumes that the stack was using It does not remove: ...

June 15, 2026 · 3 min · 606 words · Guillaume Lours

Docker Compose Tip #74: docker compose ls and cross-project visibility

docker compose ps shows the services inside the current project. docker compose ls zooms out: every Compose stack running anywhere on the host, regardless of which directory you happen to be standing in. The basics Run it from any directory: docker compose ls Sample output: NAME STATUS CONFIG FILES api-platform running(4) /home/dev/api-platform/compose.yaml data-pipeline running(2) /home/dev/data-pipeline/compose.yaml old-prototype exited(3) /tmp/prototype/compose.yaml Three columns: the project name, how many services are up, and the path to the Compose file that started it. No need to cd into the project to see what’s running. ...

June 10, 2026 · 3 min · 492 words · Guillaume Lours

Docker Compose Tip #73: expose vs ports — what actually gets published

Two directives that look similar but do completely different things. Confusing expose with ports is a classic way to either break inter-service communication or accidentally publish a database to the public internet. What each one does ports publishes a container port to the host. The outside world (and anything on the host) can reach it. services: web: image: nginx ports: - "8080:80" # host:container expose declares that a container listens on a port. It does not publish anything to the host. The directive is documentation of intent for tooling and humans. ...

June 8, 2026 · 3 min · 508 words · Guillaume Lours

Docker Compose Tip #64: Copying files with docker compose cp

Need to grab a log file out of a container? Push a quick config change for a one-off test? Don’t redeploy with a bind mount, just use docker compose cp. Basic usage The syntax mirrors docker cp but resolves service names instead of container IDs: # Copy from container to host docker compose cp <service>:<container-path> <host-path> # Copy from host to container docker compose cp <host-path> <service>:<container-path> The direction is determined by which side has the service: prefix. ...

May 18, 2026 · 2 min · 351 words · Guillaume Lours

Docker Compose Tip #57: Container resource monitoring

A container is running but your app feels sluggish. Is it CPU-bound? Leaking memory? Stuck on a runaway process? Compose gives you two essential commands to find out: docker compose top and docker compose stats. docker compose top Show running processes inside each service’s container: docker compose top myapp-web-1 UID PID PPID C STIME TTY TIME CMD root 12345 12320 0 09:15 ? 00:00:02 nginx: master process nobody 12400 12345 0 09:15 ? 00:00:00 nginx: worker process myapp-api-1 UID PID PPID C STIME TTY TIME CMD node 12500 12480 2 09:15 ? 00:01:45 node server.js node 12600 12500 0 09:15 ? 00:00:12 node worker.js You see every process running inside each container with their CPU usage (C column) and CPU time. Perfect for spotting runaway workers or unexpected child processes. ...

May 1, 2026 · 3 min · 495 words · Guillaume Lours