I have two containers. Each one is spawned in two different docker-compose. How can I link between these containers.
Example: in a single docker-compose`
But in the links part, I want to link to another container which is spawned by another docker-compose.yml in the same host. Here in the example I have linked containers of the same docker-compose.yml.
Hello! sorry for the late reply, but here goes anyway:
Compose has an “external links” feature. It allows you to link to a container that already exists (whether it was created by another compose file or not): https://docs.docker.com/compose/yml/#external-links
If would argue, however, that linking containers together would make them part of the same logical application. Generally, I like having one compose file for one application.
Hi @programmerq,
I’m just ramping up with docker and docker compose and I’d also like to use a single compose file for the entire applicaiton. Problem is, we have dozens of repos that each represent one or more containers. Many of which have dependencies on shared resources like postgres. Any organizational tips?