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