traefik/compose.yml

57 lines
1.3 KiB
YAML
Raw Normal View History

2020-06-17 06:23:01 +00:00
---
version: "3.8"
services:
traefik:
2020-10-21 07:02:31 +00:00
image: "traefik:2.3.2"
2020-06-17 06:23:01 +00:00
ports:
- target: 80
published: 80
mode: host
- target: 443
published: 443
mode: host
- target: 2222
published: 2222
mode: host
2020-06-17 06:23:01 +00:00
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "letsencrypt:/etc/letsencrypt"
configs:
- source: traefik_yml
target: /etc/traefik/traefik.yml
networks:
- proxy
environment:
- DASHBOARD_ENABLED
- LOG_LEVEL
healthcheck:
test: ["CMD", "traefik", "healthcheck"]
interval: 30s
timeout: 10s
retries: 10
start_period: 1m
2020-06-17 06:23:01 +00:00
deploy:
update_config:
failure_action: rollback
labels:
- "traefik.enable=true"
- "traefik.http.services.traefik.loadbalancer.server.port=web"
- "traefik.http.routers.traefik.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.traefik.entrypoints=web-secure"
- "traefik.http.routers.traefik.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.routers.traefik.service=api@internal"
networks:
proxy:
external: true
configs:
traefik_yml:
name: ${STACK_NAME}_traefik_yml_${TRAEFIK_YML_VERSION}
file: traefik.yml
template_driver: golang
2020-06-17 06:23:01 +00:00
volumes:
letsencrypt: