Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3'
- services:
- traefik_reverse_proxy:
- image: traefik:v2.5
- container_name: traefik
- restart: always
- # environment:
- # CF_DNS_API_TOKEN: ${CF_DNS_API_TOKEN}
- security_opt:
- - no-new-privileges:true
- ports:
- - 80:80
- - 443:443
- volumes:
- - /etc/localtime:/etc/localtime:ro
- - /var/run/docker.sock:/var/run/docker.sock:ro
- - ./data/traefik.yml:/traefik.yml:ro
- - ./data/acme.json:/acme.json
- labels:
- - traefik.enable=true
- - traefik.docker.network=av_stages
- ## Use the custom label "traefik.constraint-label=traefik-public"
- ## This public Traefik will only use services with this label
- ## That way you can add other internal Traefik instances per stack if needed
- # - traefik.constraint-label=traefik
- ## AUTH
- # - traefik.http.middlewares.traefik-auth.basicauth.users=admin:hashed-password" # ${USERNAME?Variable not set}:${HASHED_PASSWORD?Variable not set}
- # - traefik.http.routers.traefik-https.middlewares=traefik-auth
- ## https-redirect middleware to redirect HTTP to HTTPS
- ## It can be re-used by other stacks in other Docker Compose files
- - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
- - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
- ## HTTP
- - traefik.http.routers.traefik.entrypoints=http
- - traefik.http.routers.traefik.rule=Host(`traefik.domain.com`) # Host(`${DOMAIN?Variable not set}`)
- - traefik.http.routers.traefik.middlewares=https-redirect
- ## HTTPs
- - traefik.http.routers.traefik-https.entrypoints=https
- - traefik.http.routers.traefik-https.rule=Host(`traefik.domain.com`) # Host(`${DOMAIN?Variable not set}`)
- - traefik.http.routers.traefik-https.tls=true
- - traefik.http.routers.traefik-https.tls.certresolver=letsEncrypt
- - traefik.http.routers.traefik-https.tls.domains[0].main=traefik.domain.com
- - traefik.http.routers.traefik-https.tls.domains[0].sans=traefik.domain.com
- - traefik.http.routers.traefik-https.service=api@internal
- ## Define the port inside of the Docker service to use
- - traefik.http.services.traefik.loadbalancer.server.port=80
- networks:
- - av_stages
- networks:
- av_stages:
- external: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement