psu/tests/dockerfiles/docker-stack-traefik.yml
2020-01-17 12:56:02 +00:00

52 lines
1.5 KiB
YAML

version: '3.6'
services:
reverse-proxy:
image: traefik:$TRAEFIK_VERSION
# Enables the web UI and tells Traefik to listen to docker
command:
- --providers.docker=true
- --providers.docker.watch=true
- --providers.docker.exposedbydefault=false
- --entryPoints.http.address=:80
- --entryPoints.https.address=:443
- --api.dashboard=true
environment:
- HTTP_PROXY
- HTTPS_PROXY
- http_proxy
- https_proxy
- NO_PROXY
labels:
- "traefik.enable=true"
- traefik.docker.network=traefik-net
- traefik.http.middlewares.retry-if-fails.retry.attempts=10
- traefik.http.middlewares.https-only.redirectscheme.scheme=https
- traefik.http.middlewares.secured.chain.middlewares=retry-if-fails,https-only
- "traefik.http.routers.traefik.entrypoints=https"
- "traefik.http.routers.traefik.rule=Host(`traefik.$BASE_DOMAIN`)"
- "traefik.http.routers.traefik.middlewares=secured"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.service=api@internal"
ports:
- "80:80"
- 443:443
networks:
- traefik-net
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
deploy:
mode: global
placement:
constraints:
- node.role == manager
update_config:
parallelism: 1
delay: 10s
networks:
traefik-net:
driver: overlay
name: traefik-net