version: '3' services: traefik: image: traefik:latest pull_policy: always container_name: traefik restart: always security_opt: - no-new-privileges:true networks: - proxy ports: - 80:80 - 8080:8080 - 5900:5900 - 443:443 volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock:ro - /maincfg/traefik/traefik.yml:/traefik.yml:ro - /dockdata/traefik/certs/acme.json:/certs/acme.json - /dockdata/traefik/configs/:/configs/:ro - /dockdata/traefik/logs/:/logs/ labels: - "traefik.enable=true" - "traefik.http.routers.traefik.entrypoints=web" - "traefik.http.routers.traefik.rule=Host(`traefik.domain.tld`)" - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https" - "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https" - "traefik.http.routers.traefik.middlewares=traefik-https-redirect" - "traefik.http.routers.traefik-secure.entrypoints=websecure" - "traefik.http.routers.traefik-secure.rule=Host(`traefik.domain.tld`)" - "traefik.http.routers.traefik-secure.tls=true" - "traefik.http.routers.traefik-secure.tls.certresolver=production" - "traefik.http.routers.traefik-secure.middlewares=default-whitelist@file" - "traefik.http.routers.traefik-secure.service=api@internal" networks: proxy: external: true