We have several apps that are part of a larger app.
Each of these apps has a Docker Image built on every commit.
I would like to you use docker swarm mode, and docker stacks to deploy/update this larger app automatically.
Lets pretend I have this compose file (left parts out that are irrelevant)
version: '3'
services:
product_service:
image: myregistry.com/product_service:c8372d
..
cart_service:
image: myregistry.com/cart_service:ee7f32
..
When I commit a change to the cart service repo, I would like the stack to update only the cart_service
, but leave the product_service
pinned at it's current version. Also when the product service is updated I would like to be able to update only that service but leave the cart service at it's currently pinned version.
What are my options in this case?
What I can think of:
- do some fancy things and regenerate the compose file on commit and only changing the parts I need changed
- don't use
docker stack deploy
and instead use the olddocker service create
- some type of environment variable passing into the compose file (problem here is that each service would still have to know the current version of the other services right?)
- use a different stack for each service (Is there anything wrong with this or problems?)
Am I overlooking something? Was building like this not intended? What is the better approach here?