Files
stacks/traefik/compose.yml
T

65 lines
2.7 KiB
YAML
Raw Normal View History

services:
traefik:
2026-03-06 10:29:48 +01:00
image: traefik:v3
container_name: traefik
command:
2026-08-17 18:09:01 +00:00
- "--api.insecure=true"
2026-08-17 20:14:47 +02:00
- "--api.dashboard=true"
2026-08-17 17:49:42 +00:00
- "--log.level=DEBUG"
- "--accesslog=true"
- "--global.sendAnonymousUsage=false"
- "--global.checkNewVersion=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=${NETWORK_NAME}"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.web-secure.address=:443"
2026-08-17 18:09:01 +00:00
- "--entryPoints.traefik.address=:8080"
- "--entrypoints.web.http.redirections.entryPoint.to=web-secure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--entrypoints.web.http.redirections.entryPoint.permanent=true"
- "--entrypoints.web-secure.http.middlewares=security-headers@file,fail2ban@file"
- "--certificatesresolvers.resolver.acme.email=${ACME_EMAIL}"
- "--certificatesresolvers.resolver.acme.storage=/letsencrypt/acme.json"
- "--experimental.plugins.fail2ban.moduleName=github.com/tomMoulard/fail2ban"
- "--experimental.plugins.fail2ban.version=v0.9.0"
ports:
- "80:80"
- "443:443"
volumes:
- ../.data/traefik/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./dynamic:/etc/traefik/dynamic:ro
restart: always
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
labels:
- "traefik.enable=true"
- "traefik.docker.network=${NETWORK_NAME}"
- "traefik.http.middlewares.traefik-redirect-web-secure.redirectscheme.scheme=https"
- "traefik.http.routers.traefik-dashboard-web.rule=Host(`traefik.pivoine.art`)"
- "traefik.http.routers.traefik-dashboard-web.entrypoints=web"
- "traefik.http.routers.traefik-dashboard-web.middlewares=traefik-redirect-web-secure"
- "traefik.http.routers.traefik-dashboard-web.service=api@internal"
- "traefik.http.routers.traefik-dashboard-web-secure.rule=Host(`traefik.pivoine.art`)"
- "traefik.http.routers.traefik-dashboard-web-secure.entrypoints=web-secure"
- "traefik.http.routers.traefik-dashboard-web-secure.tls.certresolver=resolver"
- "traefik.http.routers.traefik-dashboard-web-secure.middlewares=vpn-only@file,security-headers@file,no-index@file"
- "traefik.http.routers.traefik-dashboard-web-secure.service=api@internal"
networks:
- compose_network
- coolify_network
networks:
compose_network:
name: ${NETWORK_NAME}
external: true
coolify_network:
name: coolify
external: true