rework pi/traefik

This commit is contained in:
Steve Dudenhoeffer 2024-03-24 05:43:52 +00:00
parent 6cdc5c1194
commit b9b11ce739

View File

@ -11,7 +11,6 @@ services:
environment: environment:
- CLOUDFLARE_EMAIL=${CLOUDFLARE_EMAIL} - CLOUDFLARE_EMAIL=${CLOUDFLARE_EMAIL}
- CLOUDFLARE_DNS_API_TOKEN=${CLOUDFLARE_KEY} - CLOUDFLARE_DNS_API_TOKEN=${CLOUDFLARE_KEY}
- DOMAIN_ROOT=${DOMAIN_ROOT}
ports: ports:
- mode: host - mode: host
@ -24,24 +23,24 @@ services:
target: 443 target: 443
volumes: volumes:
- ./traefik.yml:/etc/traefik/traefik.yml:ro - /home/steve/docker/traefik/traefik.yml:/etc/traefik/traefik.yml:ro
- ./custom:/etc/traefik/custom:ro - /home/steve/docker/traefik/custom:/etc/traefik/custom:ro
- /var/run/docker.sock:/tmp/docker.sock:ro - /var/run/docker.sock:/tmp/docker.sock:ro
- certs:/letsencrypt - certs:/letsencrypt
labels: labels:
- 'traefik.enable=true' - 'traefik.enable=true'
- 'traefik.http.routers.traefik.rule=Host(`traefik.${DOMAIN_ROOT}`)' - 'traefik.http.routers.traefik.rule=Host(`traefik.pi.dudenhoeffer.casa`)'
- "traefik.http.routers.traefik.entrypoints=websecure" - "traefik.http.routers.traefik.entrypoints=websecure"
- 'entrypoints.websecure.http.tls=true' - 'entrypoints.websecure.http.tls=true'
- 'entrypoints.websecure.http.tls.certResolver=letsencrypt' - 'entrypoints.websecure.http.tls.certResolver=letsencrypt'
- 'entrypoints.websecure.http.tls.domains[0].main=${DOMAIN_ROOT}' - 'entrypoints.websecure.http.tls.domains[0].main=pi.dudenhoeffer.casa'
- 'entrypoints.websecure.http.tls.domains[0].sans=*.${DOMAIN_ROOT}' - 'entrypoints.websecure.http.tls.domains[0].sans=*.pi.dudenhoeffer.casa'
- "traefik.http.routers.traefik.service=api@internal" - "traefik.http.routers.traefik.service=api@internal"
- 'traefik.http.routers.traefik.middlewares=strip' - 'traefik.http.routers.traefik.middlewares=strip'
- 'traefik.http.middlewares.strip.stripprefix.prefixes=/traefik' - 'traefik.http.middlewares.strip.stripprefix.prefixes=/traefik'
- 'traefik.http.services.traefik.loadbalancer.server.port=8080' - 'traefik.http.services.traefik.loadbalancer.server.port=8080'
- 'traefik.http.middlewares.authelia.forwardAuth.address=http://authelia:9091/api/verify?rd=https://login.${DOMAIN_ROOT}/' - 'traefik.http.middlewares.authelia.forwardAuth.address=http://authelia:9091/api/verify?rd=https://login.pi.dudenhoeffer.casa/'
- 'traefik.http.middlewares.authelia.forwardAuth.trustForwardHeader=true' - 'traefik.http.middlewares.authelia.forwardAuth.trustForwardHeader=true'
- 'traefik.http.middlewares.authelia.forwardAuth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email' - 'traefik.http.middlewares.authelia.forwardAuth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email'
- 'certificatesresolvers.letsencrypt.acme.dnschallenge=true' - 'certificatesresolvers.letsencrypt.acme.dnschallenge=true'
@ -57,20 +56,19 @@ services:
container_name: authelia container_name: authelia
volumes: volumes:
- authelia_config:/config - authelia_config:/config
- ./config/configuration.yml:/config/configuration.yml:ro - /home/docker/authelia/configuration.yml:/config/configuration.yml:ro
- ./config/users_database.yml:/config/users_database.yml:ro - /home/docker/authelia/users_database.yml:/config/users_database.yml:ro
environment: environment:
- DOMAIN_ROOT=${DOMAIN_ROOT} - TZ=America/New_York
- TZ=${TIMEZONE}
networks: networks:
- web - web
labels: labels:
- 'traefik.enable=true' - 'traefik.enable=true'
- 'traefik.http.routers.authelia.rule=Host(`login.${DOMAIN_ROOT}`)' - 'traefik.http.routers.authelia.rule=Host(`login.pi.dudenhoeffer.casa`)'
- 'traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://login.${DOMAIN_ROOT}/' # yamllint disable-line rule:line-length - 'traefik.http.middlewares.authelia.forwardauth.address=http://authelia:9091/api/verify?rd=https://login.pi.dudenhoeffer.casa/' # yamllint disable-line rule:line-length
- 'traefik.http.middlewares.authelia.forwardauth.trustForwardHeader=true' - 'traefik.http.middlewares.authelia.forwardauth.trustForwardHeader=true'
- 'traefik.http.middlewares.authelia.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email' # yamllint disable-line rule:line-length - 'traefik.http.middlewares.authelia.forwardauth.authResponseHeaders=Remote-User,Remote-Groups,Remote-Name,Remote-Email' # yamllint disable-line rule:line-length
- 'traefik.http.services.authelia.loadbalancer.server.port=9091' - 'traefik.http.services.authelia.loadbalancer.server.port=9091'