forked from eth-educators/eth-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
traefik-cf.yml
74 lines (71 loc) · 2.67 KB
/
traefik-cf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
version: "3.9"
x-logging: &logging
logging:
driver: json-file
options:
max-size: 100m
max-file: "3"
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'
services:
traefik:
image: traefik:${TRAEFIK_TAG}
restart: "unless-stopped"
command:
# - --accesslog=true
# - --accesslog.format=json
# - --accesslog.fields.defaultmode=keep
# - --accesslog.fields.headers.defaultmode=keep
# - --certificatesResolvers.letsencrypt.acme.caServer=https://acme-staging-v02.api.letsencrypt.org/directory
- --log.level=${LOG_LEVEL:-info}
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --certificatesresolvers.letsencrypt.acme.dnschallenge=true
- --certificatesresolvers.letsencrypt.acme.dnschallenge.provider=cloudflare
- --certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL}
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
- --entrypoints.web.address=:${TRAEFIK_WEB_HTTP_PORT}
- --entrypoints.web.http.redirections.entrypoint.to=websecure
- --entrypoints.web.http.redirections.entrypoint.scheme=https
- --entrypoints.websecure.address=:${TRAEFIK_WEB_PORT}
- --metrics
- --metrics.prometheus
- --global.sendAnonymousUsage
ports:
- ${HOST_IP:-}${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
environment:
- CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN}
- CF_ZONE_API_TOKEN=${CF_ZONE_API_TOKEN:-}
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- certs:/letsencrypt
- /etc/localtime:/etc/localtime:ro
labels:
- metrics.scrape=true
- metrics.path=/metrics
- metrics.port=8080
- metrics.instance=traefik
<<: *logging
cf-ddns:
image: ghcr.io/joshuaavalon/cloudflare-ddns:${DDNS_TAG}
restart: "unless-stopped"
environment:
- CF_DNS__LOG_LEVEL=${LOG_LEVEL:-info}
- CF_DNS__AUTH__SCOPED_TOKEN=${CF_DNS_API_TOKEN}
- CF_DNS__DOMAINS_0__ZONE_NAME=${DOMAIN}
- CF_DNS__DOMAINS_0__ZONE_ID=${CF_ZONE_ID:-}
- CF_DNS__DOMAINS_0__NAME=${DDNS_SUBDOMAIN}.${DOMAIN}
- CF_DNS__DOMAINS_0__PROXIED=${DDNS_PROXY}
- CF_DNS__DOMAINS_0__CREATE=true
- CF_DNS__DOMAINS_0__TYPE=A
- CF_DNS__DOMAINS_1__ZONE_NAME=${DOMAIN}
- CF_DNS__DOMAINS_1__ZONE_ID=${CF_ZONE_ID:-}
- CF_DNS__DOMAINS_1__NAME=${DDNS_SUBDOMAIN}.${DOMAIN}
- CF_DNS__DOMAINS_1__PROXIED=${DDNS_PROXY}
- CF_DNS__DOMAINS_1__CREATE=true
- CF_DNS__DOMAINS_1__TYPE=AAAA
volumes:
- /etc/localtime:/etc/localtime:ro
<<: *logging
volumes:
certs: