advancedTop 100 Interview Questions

How does Compose decide which network to put services on by default?

It automatically creates one project-scoped, user-defined bridge network (named after the project/directory) and attaches all defined services to it by default, giving them automatic DNS resolution by service name without any explicit network configuration needed.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What's the purpose of `environment:` vs `env_file:` in a compose.yaml?← Back to all Docker questions