Interview Prep/Docker/Networking and Compose

Two Compose projects need to talk to each other.

IntermediateScenarioNetworking and Compose
Answer

Situation read → Each project gets its own isolated network.

What I'd do → Create a shared external network and attach both:

networks:
  shared:
    external: true
    name: platform-net

docker network create platform-net once; services join with an explicit alias.

Why → Explicit shared network avoids publishing ports just for inter-project calls.

Interview tip → Name collisions on service names can occur; use aliases.

All Docker questions Roadmap: Docker & containers

More on Networking and Compose