Interview Prep/Docker/Networking, DNS and Compose

Compose: `service "api" depends on undefined service "db"`

BeginnerTroubleshootingNetworking, DNS and Compose
Answer

Likely causes → Service missing, defined under a profile that isn't active, or in an un-merged override file.

Diagnose → docker compose config --services; docker compose --profile x config.

Fix → Define the service or activate the profile; pass all -f files.

Prevent → Run docker compose config in CI.

All Docker questions Roadmap: Docker & containers

More on Networking, DNS and Compose