Closed m3talstorm closed 5 years ago
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.
This issue has been automatically closed because it had not recent activity during the stale period.
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.
same issue here (and discussed in https://github.com/docker/compose/issues/2075) The answer in https://stackoverflow.com/a/67149225/4442591 might help. Still searching for full example...
Any update? I think this is a very useful feature.
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