Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3.7"
- services:
- traefik:
- image: traefik:2.0.0
- ports:
- - "80:80"
- - "443:443"
- # - "8080:8080"
- volumes:
- - /var/run/docker.sock:/var/run/docker.sock
- - /docker/traefik/:/etc/traefik:rw
- - /docker/traefik/acme.json:/acme.json:rw
- - /docker/traefik/traefik.toml:/traefik.toml:ro
- deploy:
- placement:
- constraints: [node.role == manager]
- labels:
- traefik.enable: "true"
- traefik.http.middlewares.https_redirect.redirectscheme.scheme: https
- traefik.http.middlewares.https_redirect.redirectscheme.permanent: "true"
- traefik.http.routers.traefik_https.rule: "Path(`/dashboard`)"
- traefik.http.routers.traefik_https.entrypoints: websecure
- traefik.http.routers.traefik_https.tls: "true"
- traefik.http.routers.traefik_https.tls.certResolver: "letsencrypt"
- traefik.http.routers.traefik_https.tls.domains[0].main: "example.domain.tld"
- # traefik.http.routers.traefik_https.service: api@internal
- # traefik.http.routers.traefik_https.middlewares: myAuth
- # traefik.http.middlewares.myAuth.basicauth.users: "test:$1$OCALAPVm$MFNW0J9d.m.a/1RDQSQVZ0"
- traefik.http.routers.http_catchall.rule: "hostregexp(`{host:.+}`)"
- traefik.http.routers.http_catchall.entrypoints: web
- traefik.http.routers.http_catchall.middlewares: https_redirect
- [email protected]: 8080
- ################################################################
- #
- # Configuration sample for Traefik v2.
- #
- ################################################################
- ################################################################
- # Global configuration
- ################################################################
- [global]
- checkNewVersion = true
- sendAnonymousUsage = false
- ################################################################
- # Entrypoints configuration
- ################################################################
- [entryPoints]
- [entryPoints.web]
- address = ":80"
- [entryPoints.websecure]
- address = ":443"
- ################################################################
- # Traefik logs configuration
- ################################################################
- [log]
- level = "DEBUG"
- ################################################################
- # API and dashboard configuration
- ################################################################
- # Enable API and dashboard
- [api]
- dashboard = true
- debug = true
- # insecure = true
- ################################################################
- # ACME
- ################################################################
- [certificatesResolvers.letsencrypt.acme]
- email = "[email protected]"
- storage = "acme.json"
- [certificatesResolvers.letsencrypt.acme.dnsChallenge]
- provider = "netcup"
- ################################################################
- # Ping configuration
- ################################################################
- # Enable ping
- [ping]
- # Default: "traefik"
- ################################################################
- # Docker configuration backend
- ################################################################
- [providers]
- [providers.docker]
- endpoint = "unix:///var/run/docker.sock"
- defaultRule = "Host(`{{ normalize .Name }}.domain.tld`)"
- watch = true
- exposedByDefault = false
- swarmMode = true
Advertisement
Add Comment
Please, Sign In to add comment