简体   繁体   中英

How to do versioning APP with multiple docker containers

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM