Hi Folks,
I'm new to this traefik, and i'm trying to make the secure dashboard work but so far no luck
I've read many solutions over the internet here in this very same forum and still none of those worked for me, so I'm here asking for your wisdom as maybe im the problem here.
The only way it works its on insecure mode.
I have a MX record traefik.mydomain.com that points to my manager ip address.
Im trying to deploy on swarm
If there is already some solution and i couldnt find it im sorry beforehand for opening this thread but im crazy about this dashboard.
Here is my compose file
version: '3.3'
services:
traefik:
image: traefik:2.2.1
command:
- "--api.insecure=true"
- "--api.dashboard=true"
- "--api.debug=true"
- "--log.level=DEBUG"
- "--providers.docker=true"
- "--providers.docker.swarmMode=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=frontend"
- "--providers.file.filename=/traefik_conf.yaml"
- "--entryPoints.web.address=:80"
- "--entryPoints.websecure.address=:443"
- "--certificatesResolvers.le.acme.email=rgvargas@rickyflix.xyz"
- "--certificatesResolvers.le.acme.storage=/letsencrypt/acme.json"
- "--certificatesResolvers.le.acme.tlsChallenge=true"
- "--certificatesResolvers.le.acme.httpChallenge=true"
- "--certificatesResolvers.le.acme.httpChallenge.entryPoint=web"
ports:
- 80:80
- 443:443
- 8080:8080
networks:
- frontend
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- type: bind
source: /dockers/swarm/traefik/traefik_conf.yaml
target: /traefik_conf.yaml
- type: bind
source: /dockers/swarm/letsencrypt
target: /letsencrypt
labels:
# Dashboard
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.mydomain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.api.entrypoints=web"
- "traefik.http.routers.traefik-secure.rule=Host(`traefik.mydomain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
- "traefik.http.routers.traefik-secure.entrypoints=websecure"
- "traefik.http.routers.traefik-secure.tls=true"
- "traefik.http.routers.traefik-secure.tls.certresolver=le"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/,test2:$$apr1$$d9hr9HBB$$4HxwgUir3HP4EsggP/QNo0"
# Docker swarm need a dummy service for port detection
- "traefik.http.services.dummy-service.loadbalancer.server.port=59999"
deploy:
placement:
constraints: [node.role == manager]
restart_policy:
condition: on-failure
networks:
frontend:
external: true