Docker Community Forums

Share and learn in the Docker community.

How to compose shared *collections* of services

(Andy Chambers) #1

What is the best way to use docker to share a collection of services between several “microservices”. I think my question might be general enough that it doesn’t really matter what the services are but in my case, they are zookeeper, kafka, postgres and maybe a few others. I’ve been able to figure out how to make a docker-compose.yml that makes all these services available to a single app, but lets say I have another 5 apps, each with it’s own project but all wishing to use this collection of services. Given that kafka is our “event bus”, no app actually connects directly with another so none necessarily “depends” on another

Should each app just copy/paste the relevant parts of the original compose.yml or is there a better way?

If you want to test the integration of app a, and app b, how would you go about it? Does anyone have something like an “docker-integration.yml” that stands up all your services and runs some tests? Where do you keep that? In a repo specifically for integration testing?