Hello,
I hope you are doing well.
I need some help because the documentation is far too unclear for me. I tried to configure Traefik with Docker Swarm to access the dashboard via 0.0.0.0/dashboard/
, but I keep getting a 404 not found
.
Here is my Docker Compose configuration for Traefik:
docker-compose.yml
services:
####### Traefik #######
reverse-proxy:
image: traefik:latest
command:
# ————————— Dashboard ————————— #
- --api=true
# —————— Provider Docker —————— #
- --providers.swarm.exposedByDefault=false
- --providers.swarm.endpoint=unix:///var/run/docker.sock
# ———————— Entrypoint ————————— #
- --entrypoints.web.address=:80
ports:
- target: 80
published: 80
mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- proxy-network
deploy:
mode: replicated
replicas: 1
placement:
constraints: [node.role == manager]
labels:
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`0.0.0.0`)"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=admin:$$2y$$10$$1t34DNgXSMiNlZEtNSGFuO65fc37tPuqD6av5Px6YZIj9aFBd.DTW"
#######################
##### SWARM NETWORK #####
networks:
proxy-network:
driver: overlay
attachable: true
#########################
docker swarm init
docker stack deploy -c docker-compose.yml traefik