Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- secrets:
- cf-token:
- file: ./cf-token
- services:
- traefik:
- image: traefik:latest
- container_name: traefik
- restart: unless-stopped
- security_opt:
- - no-new-privileges:true # helps to increase security
- secrets:
- - cf-token # the secret at the top of this file
- env_file:
- - .env # store other secrets e.g., dashboard password
- networks:
- proxy:
- ports:
- - 80:80
- - 443:443
- environment:
- - TRAEFIK_DASHBOARD_CREDENTIALS=${TRAEFIK_DASHBOARD_CREDENTIALS}
- # - [email protected] # Cloudflare email
- # - CF_DNS_API_TOKEN=YOUR-TOKEN # Cloudflare API Token
- - CF_DNS_API_TOKEN_FILE=/run/secrets/cf-token # see https://doc.traefik.io/traefik/https/acme/#providers
- volumes:
- - /etc/localtime:/etc/localtime:ro
- - /var/run/docker.sock:/var/run/docker.sock:ro
- - /traefik/docker/traefik.yml:/traefik.yaml:ro
- - /traefik/docker/acme.json:/acme.json
- - /traefik/config.yml:/config.yml:ro
- - /traefik/docker/logs:/var/log/traefik
- labels:
- - "traefik.enable=true"
- - "traefik.http.routers.traefik.entrypoints=http"
- - "traefik.http.routers.traefik.rule=Host(`traefik.steinhardt0620.xyz`)"
- - "traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIK_DASHBOARD_CREDENTIALS}"
- - "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=https"
- - "traefik.http.routers.traefik-secure.rule=Host(`traefik.steinhardt0620.xyz`)"
- - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
- - "traefik.http.routers.traefik-secure.tls=true"
- - "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
- - "traefik.http.routers.traefik-secure.tls.domains[0].main=steinhardt0620.xyz"
- - "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.steinhardt0620.xyz"
- - "traefik.http.routers.traefik-secure.service=api@internal"
- networks:
- proxy:
- external: true # or comment this line to auto create the network
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement