Files
docker-traefik/docker-compose.yml
T

47 lines
1.5 KiB
YAML

networks:
frontend:
external: true
name: frontend
backend:
services:
# Configuration de Traefik
traefik:
image: ${TRAEFIK_IMAGE}
container_name: traefik
ports:
- "80:80"
- "443:443"
command:
- "--api.dashboard=true"
- "--api.insecure=false"
#
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=frontend"
- "--providers.file.filename=./tls.yaml"
#
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--entrypoints.web.http.redirections.entrypoint.permanent=true"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.websecure.http.tls=true"
#
labels:
- "traefik.enable=true"
#
- "traefik.http.routers.traefik_dashboard.rule=Host(`${TRAEFIK_URL}`)"
- "traefik.http.routers.traefik_dashboard.entrypoints=websecure"
- "traefik.http.routers.traefik_dashboard.service=api@internal"
- "traefik.http.routers.traefik_dashboard.tls=true"
- "traefik.http.middlewares.traefik_dashboard-auth.basicauth.users=${TRAEFIK_HTPASSWD}"
- "traefik.http.routers.traefik_dashboard.middlewares=traefik_dashboard-auth@docker"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./certs:/certs:ro
networks:
- frontend
- backend