2020-11-28 22:51:37 +01:00
|
|
|
services:
|
|
|
|
|
|
|
|
traefik:
|
2022-01-10 19:01:53 +01:00
|
|
|
image: traefik:${TRAEFIK_VERSION}
|
2020-11-28 22:51:37 +01:00
|
|
|
restart: unless-stopped
|
2023-12-15 15:08:44 +01:00
|
|
|
environment:
|
2021-03-20 01:32:35 +01:00
|
|
|
- NETCUP_ENDPOINT=${NETCUP_ENDPOINT}
|
|
|
|
- NETCUP_CUSTOMER_NUMBER=${NETCUP_CUSTOMER_NUMBER}
|
|
|
|
- NETCUP_API_KEY=${NETCUP_API_KEY}
|
|
|
|
- NETCUP_API_PASSWORD=${NETCUP_API_PASSWORD}
|
2020-11-28 22:51:37 +01:00
|
|
|
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"
|
2021-04-01 19:20:06 +02:00
|
|
|
- "--providers.docker.endpoint=tcp://docker-socket-proxy:2375"
|
2020-11-28 22:51:37 +01:00
|
|
|
#- "--log.level=DEBUG"
|
2021-11-03 14:48:17 +01:00
|
|
|
- "--log.level=INFO"
|
2021-04-01 19:20:06 +02:00
|
|
|
#- "--accesslog=true"
|
2023-06-09 08:58:54 +02:00
|
|
|
- "--ping=true"
|
2020-11-28 22:51:37 +01:00
|
|
|
- "--entrypoints.web.address=:80"
|
|
|
|
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
|
|
|
|
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
|
|
|
|
- "--entrypoints.websecure.address=:443"
|
|
|
|
- "--providers.file.filename=/etc/traefik/tls.toml"
|
2021-03-20 01:32:35 +01:00
|
|
|
- "--certificatesresolvers.netcup.acme.dnschallenge=true"
|
|
|
|
- "--certificatesresolvers.netcup.acme.dnsChallenge.provider=netcup"
|
|
|
|
- "--certificatesresolvers.netcup.acme.dnsChallenge.resolvers=46.38.225.230:53,46.38.252.230:53"
|
2021-11-03 14:48:17 +01:00
|
|
|
- "--certificatesresolvers.netcup.acme.dnschallenge.delayBeforeCheck=900"
|
2021-03-20 01:32:35 +01:00
|
|
|
- "--certificatesresolvers.netcup.acme.email=${LETSENCRYPT_MAIL}"
|
|
|
|
- "--certificatesresolvers.netcup.acme.storage=/letsencrypt/acme.json"
|
2023-02-07 13:50:20 +01:00
|
|
|
- "--metrics.prometheus=true"
|
|
|
|
- "--metrics.prometheus.addEntryPointsLabels=true"
|
|
|
|
- "--metrics.prometheus.addRoutersLabels=true"
|
|
|
|
- "--metrics.prometheus.addServicesLabels=true"
|
2020-11-28 22:51:37 +01:00
|
|
|
ports:
|
|
|
|
- "80:80"
|
|
|
|
- "443:443"
|
|
|
|
networks:
|
|
|
|
- web
|
2021-11-24 09:38:52 +01:00
|
|
|
- dockersocket
|
2020-11-28 22:51:37 +01:00
|
|
|
volumes:
|
2023-06-05 14:57:29 +02:00
|
|
|
- ${VOLUMES_PATH}/proxy/letsencrypt:/letsencrypt
|
2020-11-28 22:51:37 +01:00
|
|
|
- $PWD/tls.toml:/etc/traefik/tls.toml
|
2023-06-09 08:58:54 +02:00
|
|
|
healthcheck:
|
|
|
|
test: traefik healthcheck --ping
|
|
|
|
interval: 3s
|
|
|
|
timeout: 1s
|
2020-11-28 22:51:37 +01:00
|
|
|
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"
|
2021-03-20 01:32:35 +01:00
|
|
|
- "traefik.http.routers.dashboard.tls.certresolver=netcup"
|
|
|
|
- "traefik.http.routers.dashboard.tls.domains[0].main=${DOMAIN}"
|
|
|
|
- "traefik.http.routers.dashboard.tls.domains[0].sans=*.${DOMAIN}"
|
2021-01-17 15:29:26 +01:00
|
|
|
- "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}"
|
2021-03-28 13:50:02 +02:00
|
|
|
- "docker.group=proxy"
|
2024-06-26 12:34:44 +02:00
|
|
|
- "diun.enable=true"
|
2020-11-28 22:51:37 +01:00
|
|
|
|
2021-04-01 19:20:06 +02:00
|
|
|
docker-socket-proxy:
|
|
|
|
image: tecnativa/docker-socket-proxy
|
|
|
|
restart: unless-stopped
|
2023-12-15 15:08:44 +01:00
|
|
|
volumes:
|
2021-04-01 19:20:06 +02:00
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
|
|
|
environment:
|
2021-11-24 09:38:52 +01:00
|
|
|
# grant privileges as environment variables: https://github.com/Tecnativa/docker-socket-proxy#grant-or-revoke-access-to-certain-api-sections
|
2024-04-05 08:34:19 +02:00
|
|
|
- LOG_LEVEL=warning
|
2021-11-24 09:38:52 +01:00
|
|
|
- CONTAINERS=1
|
2023-06-09 08:58:54 +02:00
|
|
|
- INFO=1
|
2023-12-15 15:08:44 +01:00
|
|
|
- IMAGES=1 # for diun
|
2021-04-01 19:20:06 +02:00
|
|
|
networks:
|
2021-11-24 09:38:52 +01:00
|
|
|
- dockersocket
|
2023-06-09 08:58:54 +02:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost:2375/version"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 3s
|
2021-11-24 09:38:52 +01:00
|
|
|
privileged: true
|
2024-06-26 12:34:44 +02:00
|
|
|
labels:
|
|
|
|
- "docker.group=proxy"
|
|
|
|
- "diun.enable=true"
|
2021-04-01 19:20:06 +02:00
|
|
|
|
2020-11-28 22:51:37 +01:00
|
|
|
|
2024-03-05 10:04:20 +01:00
|
|
|
# whoami:
|
|
|
|
# image: traefik/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=netcup"
|
|
|
|
# - "docker.group=proxy"
|
|
|
|
# restart: unless-stopped
|
2020-11-28 22:51:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
web:
|
|
|
|
external: true
|
2021-11-24 09:38:52 +01:00
|
|
|
dockersocket:
|
|
|
|
external: true
|