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

Docker Compose Tip #40: Using labels for service organization and monitoring

Labels are key-value metadata attached to containers. They cost nothing at runtime but unlock powerful filtering, organization, and tool integrations. Adding labels to services services: api: image: myapp-api labels: com.example.team: "backend" com.example.env: "production" com.example.version: "2.1.0" worker: image: myapp-worker labels: com.example.team: "backend" com.example.env: "production" com.example.role: "async-processing" You can also use the list syntax: services: api: image: myapp-api labels: - "com.example.team=backend" - "com.example.env=production" Filtering with labels Labels become powerful with docker compose ps: ...

March 16, 2026 · 2 min · 258 words · Guillaume Lours

Docker Compose Tip #33: Using logging drivers and options

Take control of your container logs! Configure different logging drivers for better management, rotation, and analysis. Default logging: json-file By default, Docker uses the json-file driver: services: app: image: myapp logging: driver: json-file options: max-size: "10m" # Rotate after 10MB max-file: "3" # Keep 3 rotated files compress: "true" # Compress rotated files Without rotation, logs can fill your disk! Common logging drivers 1. Local driver (efficient storage) Optimized for performance and disk usage: ...

February 27, 2026 · 3 min · 536 words · Guillaume Lours

Docker Compose Tip #25: Using docker compose events for monitoring

Track everything happening in your Compose stack! Events provide real-time insights into container lifecycle changes. Basic event monitoring Watch events as they happen: # Stream all events docker compose events # JSON format for parsing docker compose events --json # Specific services only docker compose events web worker # Since a specific time docker compose events --since "2026-02-06T10:00:00" Event types Common events you’ll see: container create # Container created container start # Container started container stop # Stop initiated container die # Container exited container destroy # Container removed health_status # Health check changed network connect # Network attached network disconnect # Network detached Processing events Parse with jq: ...

February 6, 2026 · 3 min · 555 words · Guillaume Lours