-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
80 lines (76 loc) · 2.51 KB
/
docker-compose.yml
File metadata and controls
80 lines (76 loc) · 2.51 KB
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
76
77
78
79
80
# PatchPanel standalone deployment via Docker Compose.
#
# This is the third PatchPanel deployment surface:
# 1. Home Assistant add-on (haproxy/patchpanel as an HA addon)
# 2. Debian package (.deb) (apt install patchpanel haproxy)
# 3. Docker Compose (this file)
#
# The patchpanel image is published to containers.startcloud.com.
# To build locally instead, replace `image: ...` with `build: .`.
#
# First boot:
# docker compose up -d
# docker compose logs -f patchpanel # prints the setup token
# # Open https://<host>:8099, paste the setup token, finish the wizard.
services:
patchpanel:
image: public.containers.startcloud.com/startcloud/patchpanel:latest
container_name: patchpanel
restart: unless-stopped
ports:
- '8099:8099' # Management UI / API
volumes:
- patchpanel-config:/etc/patchpanel # config.yaml, .jwt-secret, setup.token, ssl/
- patchpanel-data:/var/lib/patchpanel # state.json, audit.sqlite, snapshots/
- patchpanel-logs:/var/log/patchpanel # file-rotated logs (journald is sink in non-Docker)
- haproxy-config:/etc/haproxy # rendered haproxy.cfg, certs/, crt-lists
- haproxy-run:/run/haproxy # master + admin sockets (shared with haproxy container)
- letsencrypt:/etc/letsencrypt # certbot account + cert store
networks:
- patchpanel
healthcheck:
test:
[
'CMD',
'node',
'-e',
"require('http').get('http://127.0.0.1:8099/health', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
haproxy:
image: haproxy:2.9
container_name: haproxy
restart: unless-stopped
ports:
- '80:80'
- '443:443'
volumes:
- haproxy-config:/etc/haproxy:ro # read-only; patchpanel owns writes
- haproxy-run:/run/haproxy # master + admin sockets
- letsencrypt:/etc/letsencrypt:ro # cert chains referenced from crt-list
networks:
- patchpanel
depends_on:
patchpanel:
condition: service_healthy
# HAProxy's entry point reads /etc/haproxy/haproxy.cfg. PatchPanel
# writes the cfg on first boot before haproxy starts (via depends_on).
command:
- -W
- -S
- /run/haproxy/master.sock,mode,600
- -f
- /etc/haproxy/haproxy.cfg
volumes:
patchpanel-config:
patchpanel-data:
patchpanel-logs:
haproxy-config:
haproxy-run:
letsencrypt:
networks:
patchpanel:
driver: bridge