Interview Prep/Docker/Networking and Compose

Which Compose features do you use for local dev vs production?

IntermediateScenarioNetworking and Compose
Answer

Situation read → Same services, different needs.

What I'd do → Base compose.yaml holds services; compose.override.yaml (auto-loaded) adds bind mounts, debug ports and develop.watch; compose.prod.yaml sets restart: unless-stopped, resource limits and no bind mounts: docker compose -f compose.yaml -f compose.prod.yaml up -d. Use profiles for optional tools.

Why → Layered files avoid duplication.

Interview tip → docker compose config shows the merged result.

All Docker questions Roadmap: Docker & containers

More on Networking and Compose