I've got a docker setup with traefik that work on my local machine (none swarm). Both services work. But in a similar setup for production (swarm) the client service works, but the admin_nginx doesn't work.
local services (both services work)
client:
image: nginx:1.17.10-alpine
volumes:
- ./client/public:/usr/share/nginx/html:cached
labels:
- traefik.http.routers.foobar_client.rule=Host(`foobar.test`)
- traefik.enable=true
networks:
- proxy
admin_nginx:
build:
context: ./admin
dockerfile: ./docker/nginx/Dockerfile.dev
volumes:
- ./admin/public:/app/public:cached
networks:
- proxy
- admin
labels:
- traefik.http.routers.foobar_admin.rule=Host(`admin.foobar.test`)
- traefik.enable=true
- traefik.docker.network=proxy
Production services (only client works)
client:
image: foobar/foobar-client
deploy:
labels:
- traefik.http.routers.foobar_client.rule=Host(`foobar.dev`, `www.foobar.dev`)
- traefik.enable=true
- traefik.http.routers.foobar_client.tls=true
- traefik.http.routers.foobar_client.tls.certresolver=foobar_resolver
- traefik.http.services.foobar_client.loadbalancer.server.port=80
admin_nginx:
image: foobar/admin-nginx
networks:
- proxy
- admin
deploy:
labels:
- traefik.http.routers.foobar_admin.rule=Host(`admin.foobar.dev`)
- traefik.enable=true
- traefik.docker.network=proxy
- traefik.http.routers.foobar_admin.tls=true
- traefik.http.routers.foobar_admin.tls.certresolver=foobar_resolver
- traefik.http.services.foobar_admin.loadbalancer.server.port=80
Any idea what I'm missing here?