2

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?

1 Answers1

0

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
Loading
  • 1,098
  • 1
  • 12
  • 25