-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.caddy.yml
More file actions
68 lines (65 loc) · 2.19 KB
/
Copy pathcompose.caddy.yml
File metadata and controls
68 lines (65 loc) · 2.19 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
# ============================================================================
# Label Printer Hub — Caddy
# Two-container setup: only the frontend is exposed via Caddy. Backend stays
# on an internal network. Caddy obtains TLS certificates automatically.
# Assumes a Caddy 2 instance with caddy-docker-proxy is running on a docker
# network called "caddy".
# ============================================================================
services:
backend:
image: ghcr.io/strausmann/label-printer-hub-backend:${HUB_VERSION:-latest}
container_name: label-printer-hub-backend
user: "1000:1000"
networks:
- hub-internal
expose:
- "${BACKEND_PORT:-8000}"
environment:
- PORT=${BACKEND_PORT:-8000}
- FORWARDED_ALLOW_IPS=${FORWARDED_ALLOW_IPS:-*}
- PRINTERS=${PRINTERS}
- SNMP_COMMUNITY=${SNMP_COMMUNITY:-public}
- DATABASE_URL=${DATABASE_URL:-sqlite:///data/printer-hub.db}
- WEBHOOK_API_KEY=${WEBHOOK_API_KEY}
- UI_BASE_URL=https://${PRINTERHUB_HOST}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
- ./data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:${BACKEND_PORT:-8000}/healthz"]
interval: 30s
timeout: 5s
retries: 3
start_period: 30s
frontend:
image: ghcr.io/strausmann/label-printer-hub-frontend:${HUB_VERSION:-latest}
container_name: label-printer-hub-frontend
user: "1000:1000"
networks:
- caddy
- hub-internal
environment:
- PORT=${FRONTEND_PORT:-8080}
- BACKEND_URL=http://backend:${BACKEND_PORT:-8000}
- LOG_LEVEL=${LOG_LEVEL:-INFO}
depends_on:
backend:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:${FRONTEND_PORT:-8080}/healthz"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
labels:
caddy: ${PRINTERHUB_HOST}
caddy.reverse_proxy: "{{upstreams ${FRONTEND_PORT:-8080}}}"
# SSE: disable response buffering for live updates
caddy.reverse_proxy.flush_interval: "-1"
networks:
caddy:
external: true
hub-internal:
driver: bridge