Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to store a docker-compose.yml when combing x number of microservices from different github repositories

I'm new to micro services and docker. I have 3 micro services from 3 different Github repositories and languages that I want to include in a docker-compose.yml file. From what I've read I know how to do this if I'm doing a local build, which is to put each repository in a sub-folder under a parent that also has the compose file in the parent. What I don't know is how would I store that same compose file in Github so the build can be replicated in the future using jenkins. Or is there a different way I should be doing this?

like image 342
muddyWildcat Avatar asked Dec 22 '25 09:12

muddyWildcat


1 Answers

There are multiple ways:

  1. You could create a mono repository and combine the 3 micro services into a single repo
  2. You could create a fourth repository which only contains the docker-compose file and use git submodules to reference the other 3 repositories
  3. You could create a fourth repository with only the docker-compose file and use an internal/company docker registry to reference the images. Each micro service repository has to include code to build and upload the docker image by itself.
  4. Since you work with jenkins, maybe check this out? Checkout multiple git repos into same Jenkins workspace

If i had to choose i would go for the first solution since it makes everything alot simpler:

  • You have an actually working version on a single commit
  • Your tests can span over all microservices and you can do true E2E tests before merging your code
  • Dev setup is much simpler, since they only have to checkout a single repository. You can add helper scripts to start everything etc
like image 139
Loading Avatar answered Dec 23 '25 22:12

Loading



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!