I have a docker container called node
that I want to scale to n containers.
A given node
container needs to know which container it is in the set of n
The latest version of docker should be able to autodiscover scaled services. For example:
services:
app: {}
worker: {}
Run scale after booting up your docker-compose:
docker-compose scale worker=10
Your app container can call the services via:
http://worker{:port}
Docker will pick a random running worker container to forward the request to.