Interview Prep/Docker/Docker Compose

How do containers in Compose reach each other?

BeginnerConceptDocker Compose
Answer

Compose creates a project network (<project>_default) and every service joins it; services resolve each other by service name (and aliases). Use the container port, not the published host port: db:5432, not localhost:5433.

All Docker questions Roadmap: Docker & containers

More on Docker Compose