hi all, i have been trying to configure traefik on my docker swarm for several days without success, currently my compose file is the following:
version: '3'
services:
traefik:
image: traefik:v2.5
ports:
- "80:80"
- "443:443"
# (Optional) Expose Dashboard
- "8080:8080" # Don't do this in production!
networks:
- traefik-public
volumes:
- /volume1/docker/traefik/etc:/etc
- traefik-public-certificates:/certificates
- /var/run/docker.sock:/var/run/docker.sock:ro
command:
# Definizione configurazioni globali
- --global.checkNewVersion
- --global.sendAnonymousUsage
# Definizione configurazione dashboard
- --api.dashboard=true
- --api.insecure=true
- --api.debug=true # enable additional endpoints for debugging and profiling
- --log.level=DEBUG # debug while we get it working, for more levels/info see https://docs.traefik.io/observability/logs/
# Definizione degli entrypoints
- --entryPoints.web.address=:80
- --entryPoints.web.http.redirections.entryPoint.to=websecure
- --entryPoints.web.http.redirections.entryPoint.scheme=https
- --entryPoints.websecure.address=:443
# Definizione del risolutore di certificati
# Di staging
- --certificatesResolvers.staging.acme.email=giuseppe9909@gmail.com
- --certificatesResolvers.staging.acme.storage=/certificates/acme.json
- --certificatesResolvers.staging.acme.caServer="https://acme-staging-v02.api.letsencrypt.org/directory"
- --certificatesResolvers.staging.acme.httpChallenge.entryPoint=web
# Di produzione
- --certificatesResolvers.production.acme.email=giuseppe9909@gmail.com
- --certificatesResolvers.production.acme.storage=/certificates/acme.json
- --certificatesResolvers.production.acme.caServer="https://acme-v02.api.letsencrypt.org/directory"
- --certificatesResolvers.production.acme.httpChallenge.entryPoint=websecure
# Definizione dei providers
- --providers.docker=true
- --providers.docker.swarmmode=true
- --providers.docker.exposedByDefault=false
- --providers.docker.network=traefik-public
# - --providers.docker.constraints=Label(`traefik.constraint-label`, `traefik-public`)
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
whoami:
image: traefik/whoami
networks:
- traefik-public
labels:
- traefik.enable=true
- traefik.docker.network=traefik-public
- traefik.http.routers.whoami.entrypoints=web
- traefik.http.routers.whoami.rule=Host(`whoami.home.services`)
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
# Volume per il salvataggio dei certificati. Si trova solo sul nodo master
volumes:
traefik-public-certificates:
networks:
traefik-public:
external: true
The traefik container is deployed without problems in the log and the same goes for whoami, when I access the traefik dashboard but I don't see any routers create with whoami. Am I doing something wrong ? I really don't know which way to go