-
Notifications
You must be signed in to change notification settings - Fork 1
/
traefik.yml
76 lines (71 loc) · 2.47 KB
/
traefik.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
75
version: '3.5'
services:
traefik:
image: traefik:v2.1
command: >
--entryPoints.web.address=:80
--entryPoints.websecure.address=:443
--certificatesResolvers.le.acme.email=${ACME_EMAIL}
--certificatesResolvers.le.acme.storage=acme.json
--certificatesResolvers.le.acme.httpChallenge.entryPoint=web
--providers.docker.endpoint=unix:///var/run/docker.sock
--providers.docker.swarmMode=true
--providers.docker.exposedByDefault=false
--providers.docker.network='traefik-public'
--api
--log.level="DEBUG"
--serverstransport.insecureskipverify
--metrics.influxdb=true
--metrics.influxdb.address=influx:8086
--metrics.influxdb.protocol=http
--metrics.influxdb.database=traefik
--metrics.influxdb.username=traefik
--metrics.influxdb.password=traefik
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s
placement:
constraints:
- node.role == manager
- node.labels.mysensors == yes
labels:
- "traefik.enable=true"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
# global redirect to https
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirs.entrypoints=web"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
# Dashboard
- "traefik.http.routers.api.rule=Host(`traefik.juletraesfoden.dk`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.middlewares=whitelist"
- "traefik.http.routers.api.tls.certresolver=le"
- "traefik.http.services.api.loadbalancer.server.port=8080"
- "traefik.http.middlewares.whitelist.ipwhitelist.sourcerange=192.168.0.0/16"
- "traefik.http.middlewares.myAuth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/"
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
- 8383:8080
networks:
- traefik-public
- grafing
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /docker/traefik/acme-v2.1.json:/acme.json
networks:
traefik-public:
external: true
grafing:
external: true