Advertisement
daredevil001

docker-compose.yml

Jan 4th, 2022 (edited)
391
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.33 KB | None | 0 0
  1. version: '3'
  2. services:
  3.   traefik_reverse_proxy:
  4.     image: traefik:v2.5
  5.     container_name: traefik
  6.     restart: always
  7.     # environment:
  8.     #   CF_DNS_API_TOKEN:  ${CF_DNS_API_TOKEN}
  9.     security_opt:
  10.      - no-new-privileges:true
  11.     ports:
  12.      - 80:80
  13.       - 443:443
  14.     volumes:
  15.      - /etc/localtime:/etc/localtime:ro
  16.       - /var/run/docker.sock:/var/run/docker.sock:ro
  17.       - ./data/traefik.yml:/traefik.yml:ro
  18.       - ./data/acme.json:/acme.json
  19.     labels:
  20.      - traefik.enable=true
  21.       - traefik.docker.network=av_stages
  22.         ## Use the custom label "traefik.constraint-label=traefik-public"
  23.         ## This public Traefik will only use services with this label
  24.         ## That way you can add other internal Traefik instances per stack if needed
  25.       # - traefik.constraint-label=traefik
  26.         ## AUTH
  27.       # - traefik.http.middlewares.traefik-auth.basicauth.users=admin:hashed-password" # ${USERNAME?Variable not set}:${HASHED_PASSWORD?Variable not set}
  28.       # - traefik.http.routers.traefik-https.middlewares=traefik-auth
  29.         ## https-redirect middleware to redirect HTTP to HTTPS
  30.         ## It can be re-used by other stacks in other Docker Compose files
  31.       - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
  32.       - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true
  33.         ## HTTP
  34.       - traefik.http.routers.traefik.entrypoints=http
  35.       - traefik.http.routers.traefik.rule=Host(`traefik.domain.com`) # Host(`${DOMAIN?Variable not set}`)
  36.       - traefik.http.routers.traefik.middlewares=https-redirect
  37.         ## HTTPs
  38.       - traefik.http.routers.traefik-https.entrypoints=https
  39.       - traefik.http.routers.traefik-https.rule=Host(`traefik.domain.com`) # Host(`${DOMAIN?Variable not set}`)
  40.       - traefik.http.routers.traefik-https.tls=true
  41.       - traefik.http.routers.traefik-https.tls.certresolver=letsEncrypt
  42.       - traefik.http.routers.traefik-https.tls.domains[0].main=traefik.domain.com
  43.       - traefik.http.routers.traefik-https.tls.domains[0].sans=traefik.domain.com
  44.       - traefik.http.routers.traefik-https.service=api@internal
  45.         ## Define the port inside of the Docker service to use
  46.       - traefik.http.services.traefik.loadbalancer.server.port=80
  47.     networks:
  48.      - av_stages
  49.  
  50. networks:
  51.   av_stages:
  52.     external: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement