I am trying to deploy at least two instances of a compose file to a docker swarm - using traefik to route traffic to review apps based onthe commit branch name.
So I add labels like this to the docker compose:
service-x:
deploy:
labels:
traefik.enable: true
traefik.http.routers.review_app.rule: Host("${CI_BRANCH}.${DOMAIN}")
traefik.http.services.review_app.loadbalancer.server.port: 5000
However, traefik sees all of these as a single router (review_app) even though they all belong to different docker stacks.
How do I possibly deploy one compose file twice, with non conflicting routers?
And, why is this even an issue? Traefik understands that the "traefik.enable" table belongs to this specific service an no other, so it knows which service and stack its processing labels for.