DELAPARRA
Index
Color
NL
Category: Docker

networks (compose)

Explained by Updated

What is networks (compose)?

networks (compose): Defines custom networks and which services join them. Services on the same network reach each other by service name. In Docker Compose, networks defines custom networks and which services join them. Services on the same network can reach each other by service name; services on different networks cannot. By default, Compose puts all services of a project on one network, which is enough for most setups. Custom networks are useful when you want separation, such as a front-end network for the web server and a back-end network for the database, so the web server can reach the app and the app can reach the database, but the web server cannot reach the database directly.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about networks (compose)

What should you keep in mind with networks (compose)?

Networks marked external let several Compose projects share one network, for example a reverse proxy that serves multiple applications. Keep the setup simple, though; more networks mean more to understand when something cannot connect.

What does an example of networks (compose) look like?

services: web: networks: [frontend] networks: frontend: {}

At a glance

CategoryDocker
Explained by
Updated

More Docker terms

All terms starting with N

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.