Private network
All containers of a server share one Docker network, where they call each other by name.
Each container of the server joins one Docker network.
Ferry makes one Docker bridge network for each server. Its name is the name prefix: ferry by default. This is the private network. Each container of the server joins it: service instances, one-off jobs, cron jobs and datastores.
Each service instance gets a DNS alias equal to the name of the service. Each datastore gets an alias equal to its name.
Call a service by its name
curl http://api:3000/health # a private service named "api" listening on 3000
psql postgresql://…@app-db:5432/… # a datastore named "app-db"Do not write hosts and ports in your code. Use a reference (References): ${{service.api.hostport}} becomes api:3000 when the service starts.
Private services
A private service is reachable only here. It also needs a port: Ferry finds it the same way as for a web service. ferry show NAME prints it as the internal address.
Internal address: api:3000No isolation between services
All services of one server share this network. Ferry does not isolate the services from each other on it.
The alias resolves to the addresses of all the instances. The DNS of Docker answers. Ferry does not balance this traffic.