Docker Compose Tip #19: Override files for local development

Keep production and development configs separate. Docker Compose automatically merges compose.override.yml for local development tweaks. The magic Compose automatically loads two files: compose.yml (base configuration) compose.override.yml (local overrides) # These are equivalent: docker compose up docker compose -f compose.yml -f compose.override.yml up Basic setup compose.yml (production-ready): services: web: image: myapp:latest ports: - "80:80" environment: NODE_ENV: production LOG_LEVEL: warn compose.override.yml (developer-friendly): services: web: build: . # Build locally instead of using image ports: - "3000:80" # Different port for development volumes: - .:/app # Mount source code environment: NODE_ENV: development LOG_LEVEL: debug DEBUG: "true" Real development example compose.yml: ...

January 29, 2026 · 2 min · 348 words · Guillaume Lours

Docker Compose Tip #5: Writing Compose files for AI tools

AI tools work better when they understand the setup. Here’s how to document Compose files effectively. Add context with comments Comments help AI understand what each service does: services: # Primary web application serving React frontend # Handles user authentication and API gateway web: image: myapp:latest ports: - "3000:3000" # Public facing port - update in .env for production environment: # Connection string to PostgreSQL - format: postgresql://user:pass@host:5432/db DATABASE_URL: ${DATABASE_URL} # JWT secret for auth - must be at least 256 bits JWT_SECRET: ${JWT_SECRET} depends_on: db: condition: service_healthy # Development only - remove for production volumes: - ./src:/app/src # Hot reload for development # PostgreSQL 15 database with PostGIS extension # Stores user data and geographic information db: image: postgis/postgis:15-3.3 environment: POSTGRES_DB: myapp POSTGRES_PASSWORD: ${DB_PASSWORD} # Never commit actual password volumes: # Initial schema and seed data - ./init.sql:/docker-entrypoint-initdb.d/01-init.sql # Persistent data storage - postgres_data:/var/lib/postgresql/data volumes: postgres_data: # Named volume for database persistence across container restarts File headers For bigger projects, add a header: ...

January 9, 2026 · 3 min · 436 words · Guillaume Lours

Docker Compose Tip #1: Debug your configuration with config

When your Compose setup gets complex, docker compose config becomes your best debugging tool. Especially with profiles. The basics docker compose config This shows you the actual configuration that Docker Compose will run: Environment variables are replaced with their values Relative paths become absolute Default values are applied Multiple compose files are merged YAML anchors are resolved What you write: services: web: image: myapp:${VERSION:-latest} volumes: - ./data:/app/data environment: DATABASE_URL: ${DATABASE_URL} What docker compose config shows you: ...

January 5, 2026 · 2 min · 401 words · Guillaume Lours