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
Feature Request: Add depends_on support for external Compose files #3951
Comments
Hi! Do you mind giving an example of a case where you feel that would be useful? I have a feeling it's already possible to do what you need with the current Compose feature set, but I'd like to understand your setup better first. |
@shin- Sure, we are adding a separate application logging stack, that's made up of several containers. This logging stack is based on ElasticSearch, Logstash, and Kibana (ELK). We'd like to leave this in a separate Compose file, so we can deploy and validate it separately from our microservices. What is your recommended approach for this scenario? |
You can have multiple Compose files, one called |
@shin- Thanks -- we will give that a shot! |
I have a similar issue, asked on SO: http://stackoverflow.com/questions/39892588/avoiding-port-conflicts-between-docker-compose-yml-configurations |
This issue has leg. The scenario we need the external depends_on is to start the services only if a reverse-proxy service is started and be running already from another project. The reverse-proxy project will compose the shared network and be ready as soon as the backend services come up. |
We would also like this. I am running an integration tests inside jenkins. The first docker-compose file is used to set up and configure the services I'm testing. The second docker-compose file is to run the actual tests. I then want the Jenkins job to pass or fail depending on the results of the test in the second docker-compose file. |
docker-compose.yml version: '2.1'
services:
web:
...
db:
...
volumes:
...
networks:
... docker-compose-tests.yml version: '2.1'
services:
testrunner:
... Run application: |
@shin- One of my containers starts a database, the second one loads data into the database, then I have several containers that launch microservices that talk to that database. Then the last service runs my tests against those services. When I tried your suggestion, I see in the logs: and as I've seen before, the stack comes down once the second container finishes loading data into the database due to the abort-on-container-exit command. I really want to abort on container exit but only for my testrunner container. |
still an issue given that moby/moby#31101 keeps us from split a docker-compose among multiple regular files: |
I also have a similar issue: I need to start several databases, run a very long import process, and finally start a set of microservices. Ideally, I should be able to break that into 3 distinct
It would be good to be able to use |
But this will require they are all in the same project as well, right? |
Has anyone managed to find a work around on depends_on in the case where you want one service to start after one has already completely loaded? |
This is exactly what the new feature request is all about! Indeed, how else - in the new syntax which would be developed - would you specify external dependency between docker-compose files? |
Just realized we have been using the We have a Definitely would be happy about this feature as well. |
For more complex applications, with many components, it would be useful to be able to make a Docker Compose service
depends_on
an externaldocker-compose.yml
file.Is this something that can be added?
Cheers,
Trevor Sullivan
Docker Captain
Microsoft MVP: Cloud & Data Center Management
https://trevorsullivan.net
https://twitter.com/pcgeek86
The text was updated successfully, but these errors were encountered: