←back to thread

152 points rgun | 2 comments | | HN request time: 0s | source
1. fuckinpuppers ◴[] No.46145121[source]
Does it support a way to bundle things close to each other, for example, not having a database container hosted in a different datacenter than the web app?
replies(1): >>46145282 #
2. jabr ◴[] No.46145282[source]
The `compose.yaml` spec for services let's you specify which machines to deploy it on, so you could target the database and web app to the same machine (or subset of machines).

There is also an internal DNS for service discovery and it supports a `nearest.` prefix, which will preferentially use instances of a service running on the same machine. For example, I run a globally replicated NATS service and then connect to it from other services using the `nearest.nats.internal` address to connect to the machine-local NATS node.