-
Notifications
You must be signed in to change notification settings - Fork 2
/
proxy-stack.yaml
66 lines (64 loc) · 2.31 KB
/
proxy-stack.yaml
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
version: "3.8"
services:
traefik:
image: traefik:v2.11
ports:
# Host mode for 80, 443 so that we get external IP addresses in X-Real-Ip header
# https://stackoverflow.com/questions/49415595/docker-swarm-get-real-ip-client-host-in-nginx
- mode: host
protocol: tcp
published: 80
target: 80
- mode: host
protocol: tcp
published: 443
target: 443
- "8080:8080" # Traefik dashboard
command:
- --api.insecure=true # Dash on port 8080 without auth. See https://docs.traefik.io/v2.0/operations/dashboard/#secure-mode
- --api.dashboard=true
- --api.debug=false
- --log.level=INFO
- --providers.docker=true
- --providers.docker.swarmmode=true
- --providers.docker.exposedbydefault=false
- --providers.docker.network=proxy_default
- --providers.file.filename=/config/dynamic_conf.yml
- --providers.file.watch=true
- --entrypoints.web.address=:80
- --entrypoints.web.http.redirections.entrypoint.to=websecure # Force HTTPS
- --entrypoints.websecure.address=:443
- --certificatesresolvers.mytlschallenge.acme.httpchallenge.entrypoint=web
- --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json
- --accesslog=true
- --accesslog.filepath=/logs/traefik.log
- --accesslog.format=json
- --accesslog.bufferingsize=0
- --accesslog.filters.statuscodes=400-498
- --accesslog.fields.headers.defaultmode=keep
environment:
- TZ=Europe/Stockholm
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /media/cluster/certs:/letsencrypt
- /media/cluster/personal-search/passwd:/passwd:ro
- /media/cluster/traefik:/config
- /media/cluster/traefik/logs:/logs
deploy:
placement:
constraints:
- "node.role==manager"
fail2ban:
image: crazymax/fail2ban
cap_add:
- NET_ADMIN
- NET_RAW
environment:
- TZ=Europe/Stockholm
- F2B_DB_PURGE_AGE=14d
volumes:
- /root/.ssh:/root/.ssh:ro
- /media/cluster/fail2ban:/data
- /media/cluster/traefik/logs/:/var/log/traefik:ro
- /media/cluster/syslog/log/:/var/log/mikrotik:ro
- /media/cluster/homeassistant/home-assistant.log:/var/log/homeassistant/home-assistant.log:ro