2021-04-26 21:23:23 +02:00
|
|
|
version: "{{ compose_version }}"
|
2021-04-24 18:15:48 +02:00
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy:
|
|
|
|
name: "{{ traefik_network }}"
|
|
|
|
|
|
|
|
services:
|
|
|
|
traefik:
|
|
|
|
image: traefik:{{ traefik_version }}
|
|
|
|
container_name: traefik
|
|
|
|
ports:
|
|
|
|
- "{{ traefik_http_port }}:80"
|
|
|
|
- "{{ traefik_https_port}}:443"
|
|
|
|
volumes:
|
2021-07-23 14:04:42 +02:00
|
|
|
- /etc/timezone:/etc/timezone:ro
|
2021-04-24 18:15:48 +02:00
|
|
|
- /etc/localtime:/etc/localtime:ro
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
- ./traefik.toml:/traefik.toml
|
|
|
|
- ./traefik_dynamic.toml:/traefik_dynamic.toml
|
|
|
|
- {{ traefik_certs_directory }}:/certs
|
|
|
|
labels:
|
|
|
|
traefik.http.routers.traefik-metrics.entrypoints: websecure
|
|
|
|
traefik.http.routers.traefik-metrics.rule: "Host(`{{ traefik_subdomain }}.{{ domain_name }}`) && PathPrefix(`/metrics`)"
|
|
|
|
traefik.http.routers.traefik-metrics.service: traefik-metrics
|
|
|
|
traefik.http.routers.traefik-metrics.middlewares: traefik-metrics-auth@docker
|
|
|
|
# htpasswd string contains $, interpreted as variable,
|
|
|
|
# escape them with double $
|
|
|
|
traefik.http.middlewares.traefik-metrics-auth.basicauth.users: "metrics:{{ traefik_metrics_htpasswd | replace("$", "$$") }}"
|
|
|
|
traefik.http.services.traefik-metrics.loadbalancer.server.port: "{{ traefik_metrics_port }}"
|
|
|
|
traefik.http.routers.traefik-api.rule: "Host(`{{ traefik_subdomain }}.{{ domain_name }}`)"
|
|
|
|
traefik.http.routers.traefik-api.service: api@internal
|
|
|
|
traefik.http.routers.traefik-api.middlewares: traefik-api-auth@docker
|
|
|
|
traefik.http.middlewares.traefik-api-auth.basicauth.users: "dashboard:{{ traefik_dashboard_htpasswd | replace("$", "$$") }}"
|
|
|
|
traefik.enable: true
|
|
|
|
environment:
|
|
|
|
GANDIV5_API_KEY: "{{ gandi_api_key }}"
|
|
|
|
networks:
|
2021-04-26 21:23:23 +02:00
|
|
|
- proxy
|
2021-04-24 18:15:48 +02:00
|
|
|
restart: unless-stopped
|