You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently I have a single docker-compose.yml file which contains 2 dozen services, out of these servies there are some which I do not want to stop when I docker-compose down. They can be logically grouped into "configuration/discovery stack", "logging stack", "persistence stack", "application stack", etc (note: the general use of 'stack' not a specific docker stack).
For example, the configuration/discovery stack is a cluster of 3 etcd services and a registrator. Multiple other stacks depend on this, and this should be rarely taken down (docker-compose down), were as the stacks that depend on it could be taken down at any time.
If all these stacks are put into a single docker-compose.yml file they are all started and stopped together (unless you docker stop a specific containers - painful)
If these stacks are seperated into individual files then I can docker-compose -f mutliple files at the same time, but the docker-compose down will bring them all down as well
Problem:
Most of the services use depends_on to specify start order (+ healthchecks), when depends_on is validated it only checks to see if the current service_config (and any merged configs ... multiple -f) contains the service name, it does not check to see if these containers are already running outside of compose (like external_links does). This means that in the below example, if elasticsearch has a depends_on on registrator it will error with ERROR: Service 'elasticsearch' depends on service 'registrator' which is undefined.
extends also doesn't seem to solve the problem because its just config copying/merging.
docker-compose -f docker-compose.etcd.yml up docker-compose -f docker-compose.elk.yml up docker-compose -f docker-compose.app.yml up
... docker-compose -f docker-compose.app.yml down
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I'm having the same kind of thought.
I guess one way to achieve this would be to have some kind of ambassador proxies for each external services. But it is subpar, it adds latency and complexifies the compose files.
I'm surprised there is not more following of this use case.
Versions:
Overview:
Currently I have a single
docker-compose.yml
file which contains 2 dozen services, out of these servies there are some which I do not want to stop when I docker-compose down. They can be logically grouped into "configuration/discovery stack", "logging stack", "persistence stack", "application stack", etc (note: the general use of 'stack' not a specific docker stack).For example, the configuration/discovery stack is a cluster of 3 etcd services and a registrator. Multiple other stacks depend on this, and this should be rarely taken down (docker-compose down), were as the stacks that depend on it could be taken down at any time.
If all these stacks are put into a single
docker-compose.yml
file they are all started and stopped together (unless youdocker stop
a specific containers - painful)If these stacks are seperated into individual files then I can
docker-compose -f
mutliple files at the same time, but thedocker-compose down
will bring them all down as wellProblem:
Most of the services use
depends_on
to specify start order (+ healthchecks), whendepends_on
is validated it only checks to see if the currentservice_config
(and any merged configs ... multiple -f) contains the service name, it does not check to see if these containers are already running outside of compose (likeexternal_links
does). This means that in the below example, ifelasticsearch
has adepends_on
onregistrator
it will error withERROR: Service 'elasticsearch' depends on service 'registrator' which is undefined.
extends
also doesn't seem to solve the problem because its just config copying/merging.Is there a way of achieving this?
Goal setup:
docker-compose.etcd.yml
docker-compose.elk.yml
docker-compose.app.yml
General operation:
docker-compose -f docker-compose.etcd.yml up
docker-compose -f docker-compose.elk.yml up
docker-compose -f docker-compose.app.yml up
...
docker-compose -f docker-compose.app.yml down
The text was updated successfully, but these errors were encountered: