-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-compose scale - how to get scale # in YAML file? #2249
Comments
A few thoughts:
I'm here to learn too so please correct me if I'm wrong. |
There are some existing issues for this: #1661, #1131 We haven't decided exactly how to support this yet. Could you tell us more about why you need these values in your application? Normally the way this would be supported (as @freefood89 suggested) is by having a separate service that watches for new containers and re-configures the load balancer. https://github.com/jwilder/nginx-proxy is one example of that. The application itself doesn't need to change the port it listens on, it always binds to the same port in the container. To get the hostname (the unique id) of the container, you can use |
Thanks for the information though; was very interesting! @dnephin I did not think about using |
I am using swarm + multi-host networking to scale out services (Druid) that advertise themselves via Zookeeper (separate instance from the swarm discovery service, which is actually Consul). Currently, if I don't set a hostname explicitly, the service advertises I can instead have it advertise the docker host IP (i.e. the result of |
|
Yep, I was just looking at the release notes for compose 1.6.1 and saw this:
Is that what you're referring to? |
yes, that's it |
I have something like this:
I want to be able to achieve three things:
To scale further, what if I wanted 10+ of these containers?
Can these only be achieved by copying and pasting my_container 10x times?
The text was updated successfully, but these errors were encountered: