Skip to content
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 depending on another Docker Compose #3971

Closed
davidbarratt opened this issue Sep 22, 2016 · 3 comments
Closed

Docker Compose depending on another Docker Compose #3971

davidbarratt opened this issue Sep 22, 2016 · 3 comments

Comments

@davidbarratt
Copy link

Is there a way for an application with a docker-compose.yml to depend on another application with docker-compose.yml?

For instance, let's pretend I have an API in one repo and a UI in another repo. And both have a docker-compose.yml file and each has it's own set of containers that are required.

Can the UI have some sort of directive that will tell it to load the API and all of it's containers?

@shin-
Copy link

shin- commented Sep 23, 2016

Hi!

You should be able to achieve something similar with extends directives: https://docs.docker.com/compose/extends/#understand-the-extends-configuration

@shin- shin- closed this as completed Sep 29, 2016
@ywen
Copy link

ywen commented Dec 16, 2016

Does extend requires multiple compose files in one repo? In this case, UI and the service will not be in the same repo.

@danielbodart
Copy link

This is a terrible answer, composition is about not know how something is implemented, a docker image and a composite docker image (compose) should be interchangeable without clients knowing that you decided to break your problem into smaller pieces or aggregated a bunch of stuff in a larger unit.

This is why the software industry prefers composition over inheritance (extends).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants