43 lines
1.7 KiB
YAML
43 lines
1.7 KiB
YAML
services:
|
|
traefik:
|
|
image: traefik:latest
|
|
container_name: traefik
|
|
command:
|
|
- "--providers.docker=true"
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
environment:
|
|
- CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN}
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ./traefik.yaml:/etc/traefik/traefik.yaml:ro
|
|
- /srv/docker/traefik:/var/traefik/certs/:rw
|
|
- traefik-logs:/var/log/traefik
|
|
networks:
|
|
- traefik
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.traefik.entrypoints=web"
|
|
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.home.gabesville.com`)"
|
|
- "traefik.http.middlewares.traefik-auth.basicauth.users=USER:BASIC_AUTH_PASSWORD"
|
|
- "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=websecure"
|
|
- "traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard.home.gabesville.com`)"
|
|
- "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=home.gabesville.com"
|
|
- "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.home.gabesville.com"
|
|
- "traefik.http.routers.traefik-secure.service=api@internal"
|
|
restart: unless-stopped
|
|
networks:
|
|
traefik:
|
|
name: traefik_network
|
|
driver: bridge
|
|
volumes:
|
|
traefik-logs: |