ArchitectureNetworking model
The private network
Each server makes one Docker bridge network where each container has a name.
Each server creates one bridge network. Its name is the prefix of the server: ferry by default.
1 / 4
The network is a user-defined bridge network. The option --name-prefix sets its name. On it, the DNS of Docker changes an alias into the address of a container.
The addresses
| To reach | Address |
|---|---|
| A service | http://NAME:PORT, for example http://api:8000 |
| A datastore | NAME:5432 (Postgres) or NAME:6379 (Redis), or its full connection string |
All the instances of a service share the alias. The DNS of Docker answers with the addresses of all of them.
Do not write the addresses by hand
Use env var references:
${{service.api.internalUrl}}
${{datastore.app-db.connectionString}}