Reputation: 416
I have a project with the following structure:
project:
- api:
- src:
- app
- db
- app:
- reactapp
each of these is specified in a docker-compose, my question is, should I versioning this as a single project, ie: git init on /project or individual for each part/container, ie: /project/api
Upvotes: 0
Views: 323
Reputation: 4122
There are a few ways of thinking about this. If your repo is meant to build the entire application, then it makes sense to have the docker-compose file be an aggregation of multiple image specs as you have specified above. It may even be possible to contain the source to generate each image inside the same repo.
However, as building and testing each image gains complexity, you may consider splitting the source into its own repo. If you do that, you can simply publish the independently built and tested split-off image to a Docker registry, and modify your docker-compose.yml in your app to pull that image instead of building from source.
I would start out with everything in one repo for simplicity's sake and split things out as needed.
Upvotes: 1