selfhost/proxy/docker-compose.yaml

62 lines
2 KiB
YAML
Raw Normal View History

2020-11-28 22:51:37 +01:00
version: "3.3"
services:
traefik:
2021-03-13 14:12:56 +01:00
image: traefik:v2.4
2020-11-28 22:51:37 +01:00
restart: unless-stopped
command:
- "--api.insecure=false"
2021-01-17 14:32:09 +01:00
- "--api.dashboard=true"
2020-11-28 22:51:37 +01:00
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
2021-03-18 16:15:52 +01:00
- "--providers.docker.network=web"
2020-11-28 22:51:37 +01:00
#- "--log.level=DEBUG"
- "--entrypoints.web.address=:80"
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myresolver.acme.email=${LETSENCRYPT_MAIL}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
- "--providers.file.filename=/etc/traefik/tls.toml"
ports:
- "80:80"
- "443:443"
networks:
- web
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- ${VOLUMES_PATH}/letsencrypt:/letsencrypt
- $PWD/tls.toml:/etc/traefik/tls.toml
labels:
2021-01-17 14:32:09 +01:00
- "traefik.enable=true"
- "traefik.http.routers.dashboard.rule=Host(`traefik.${DOMAIN}`)"
- "traefik.http.routers.dashboard.service=api@internal"
- "traefik.http.routers.dashboard.entrypoints=websecure"
- "traefik.http.routers.dashboard.tls.certresolver=myresolver"
- "traefik.http.routers.dashboard.tls.options=intermediate@file"
2021-01-17 14:32:09 +01:00
- "traefik.http.routers.dashboard.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=${HTPASSWD}"
2020-11-28 22:51:37 +01:00
- "docker.group=web"
# whoami:
# image: containous/whoami
# networks:
# - web
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.whoami.rule=Host(`whoami.${DOMAIN}`)"
# - "traefik.http.routers.whoami.entrypoints=websecure"
# - "traefik.http.routers.whoami.tls.certresolver=myresolver"
# - "docker.group=web"
# restart: unless-stopped
networks:
web:
external: true