Docker Compose Tip #24: Using profiles to organize optional services

Keep your Compose stack flexible! Profiles let you include or exclude services based on your current needs. Basic profiles Define optional services with profiles: services: app: image: myapp:latest ports: - "3000:3000" # No profile - always starts debug: image: debug-tools profiles: - debug # Only starts with --profile debug test-db: image: postgres:15 profiles: - test environment: POSTGRES_DB: test_db Starting with profiles Choose which services to include: ...

February 5, 2026 · 2 min · 376 words · Guillaume Lours

Docker Compose Tip #23: Multi-platform builds with platforms

Build once, run everywhere! Create images that work on ARM Macs, Intel servers, and Raspberry Pi with a single build command. Configure multi-arch builder Docker Desktop handles this by default. For other Docker installations, set up buildx: # Only needed if not using Docker Desktop # Create and use a new builder docker buildx create --name multiarch --use # Verify available platforms docker buildx ls Configure platforms Specify target architectures in your compose file: ...

February 4, 2026 · 3 min · 470 words · Guillaume Lours

Docker Compose Tip #22: Using secrets in Compose files

Stop hardcoding passwords! Docker Compose secrets provide a secure way to handle sensitive data. Basic secret setup Define secrets and use them in services: secrets: db_password: file: ./secrets/db_password.txt api_key: file: ./secrets/api_key.txt services: app: image: myapp:latest secrets: - db_password - api_key environment: DB_PASSWORD_FILE: /run/secrets/db_password API_KEY_FILE: /run/secrets/api_key Secrets appear as files in /run/secrets/ inside containers. Reading secrets in your app Node.js example: ...

February 3, 2026 · 2 min · 270 words · Guillaume Lours

Docker Compose Tip #21: Understanding bridge vs host networking modes

Choose the right networking mode for your containers. Understand when isolation matters and when performance is key. Bridge mode (default) The default and most secure option - containers get their own network namespace: services: web: image: nginx ports: - "8080:80" # Port mapping required networks: - app_network db: image: postgres:15 networks: - app_network networks: app_network: driver: bridge Containers can communicate using service names (web, db) within the network. ...

February 2, 2026 · 2 min · 330 words · Guillaume Lours

Docker Compose Tip #20: Using docker compose logs effectively

Stop scrolling through endless output. Master docker compose logs options to find issues fast and monitor services effectively. Basic commands # All service logs docker compose logs # Single service docker compose logs web # Multiple services docker compose logs web worker Follow logs in real-time Watch logs as they happen: # Follow all services docker compose logs -f # Follow specific service docker compose logs -f api # Start fresh and follow docker compose logs -f --since 1m Tail recent logs Get last N lines: ...

January 30, 2026 · 3 min · 427 words · Guillaume Lours