services/traefik/docker-compose.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

version: "3.8"
volumes:
traefik:
name: ${TRAEFIK_VOLUME_NAME:-traefik}
networks:
traefik:
name: ${TRAEFIK_NETWORK_NAME:-traefik}
services:
traefik:
container_name: ${TRAEFIK_CONTAINER_NAME:-traefik}
image: ${TRAEFIK_IMAGE:-traefik:v2.6.0}
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
2021-11-11 09:37:33 +01:00
- traefik:/traefik
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- target: 80
published: 80
protocol: tcp
mode: host
networks:
2021-11-11 09:37:33 +01:00
- traefik
command:
- --api.insecure=${TRAEFIK_API_INSECURE:-true}
- --log.level=${TRAEFIK_LOG_LEVEL:-INFO}
- --global.sendanonymoususage=${TRAEFIK_GLOBAL_SENDANONYMOUSUSAGE:-false}
- --global.checknewversion=${TRAEFIK_GLOBAL_CHECKNEWVERSION:-false}
- --pilot.dashboard=${TRAEFIK_PILOT_DASHBOARD:-false}
- --metrics.prometheus=${TRAEFIK_METRICS_PROMETHEUS:-true}
- --accesslog=${TRAEFIK_ACCESSLOG:-false}
- --providers.docker
- --providers.docker.exposedbydefault=false
- --providers.docker.network=${TRAEFIK_NETWORK_NAME:-traefik}
- --entryPoints.traefik.address=:8080
- --entrypoints.${TRAEFIK_ENTRYPOINTS:-web}.address=:80
- --entryPoints.${TRAEFIK_ENTRYPOINTS:-web}.forwardedHeaders.insecure
labels:
- traefik.enable=true
- traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DOMAIN:?err}`)
- traefik.http.routers.traefik.entrypoints=${TRAEFIK_ENTRYPOINTS:-web}
- traefik.http.services.traefik.loadbalancer.server.port=8080