-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
82 lines (80 loc) · 3.58 KB
/
Copy pathdocker-compose.yml
File metadata and controls
82 lines (80 loc) · 3.58 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
81
82
services:
app:
build: .
image: anonymous-feedback:latest
restart: unless-stopped
env_file:
- .env
environment:
HOST: ${HOST:-0.0.0.0}
PORT: ${PORT:-3000}
DB_PATH: ${DB_PATH:-/app/data/feedback.sqlite}
PUBLIC_BASE_URL: ${PUBLIC_BASE_URL}
PUBLIC_PATH: ${PUBLIC_PATH}
ADMIN_PATH: ${ADMIN_PATH}
ADMIN_TOKEN: ${ADMIN_TOKEN}
# Default to false in containerized deployments so the randomized
# PUBLIC_PATH does not end up in `docker logs` / log aggregators.
# Set LOG_PUBLIC_URL=true in your .env only when temporarily debugging.
# LOG_ADMIN_URL was intentionally removed: the admin URL is never logged.
LOG_PUBLIC_URL: ${LOG_PUBLIC_URL:-false}
# Optional diagnostic routes. Both default to false so they are not
# accidentally enabled in production.
# ENABLE_HEALTHCHECK=true -> exposes GET /healthz (no auth, no secrets)
# used by the container healthcheck below.
# ENABLE_DEBUG_ROUTES=true -> exposes GET /debug/routes (admin token
# required; redacted output).
ENABLE_HEALTHCHECK: ${ENABLE_HEALTHCHECK:-false}
ENABLE_DEBUG_ROUTES: ${ENABLE_DEBUG_ROUTES:-false}
expose:
- "3000"
# Persistent storage for the SQLite database.
#
# /app/data contains feedback.sqlite (+ WAL/SHM sidecars). It MUST survive
# container restarts and image rebuilds. The app fails fast on startup if
# the directory is missing or not writable by the "node" user (uid 1000).
#
# Backup (online-safe, uses SQLite's backup API — no downtime):
# docker compose exec app node -e "new (require('better-sqlite3'))(process.env.DB_PATH).backup('/app/data/feedback.backup.sqlite').then(()=>console.log('ok'))"
# docker compose cp app:/app/data/feedback.backup.sqlite ./feedback.backup.sqlite
#
# Restore (stop the app first so no WAL is active):
# docker compose stop app
# docker compose cp ./feedback.backup.sqlite app:/app/data/feedback.sqlite
# docker compose start app
#
# See README.md ("Backup and restore") for details.
volumes:
- anonymous_feedback_data:/app/data
networks:
- dokploy-network
- default
# Container-internal healthcheck. Only meaningful when
# ENABLE_HEALTHCHECK=true in .env; otherwise /healthz is not registered
# and the probe will fail. Uses Node's built-in http module so no extra
# binary (curl/wget) is required inside the image. The probe hits
# 127.0.0.1 inside the container — /healthz is NOT routed through Traefik.
healthcheck:
test:
- CMD-SHELL
- >-
node -e "require('http').get('http://127.0.0.1:'+ (process.env.PORT||3000) +'/healthz',
r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))"
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
labels:
- traefik.enable=true
- traefik.docker.network=dokploy-network
- traefik.http.routers.anonymous-feedback.rule=Host(`anonymous-feedback-fghjfghjfghsdfg-grlpi-b3c6cc-31-97-103-251.sslip.io`)
- traefik.http.routers.anonymous-feedback.entrypoints=web
- traefik.http.services.anonymous-feedback.loadbalancer.server.port=3000
# Do NOT expose /healthz or /debug/routes through Traefik. They are
# container-internal only. If you truly need external monitoring of
# /healthz, add a dedicated router restricted by IP allowlist middleware.
volumes:
anonymous_feedback_data:
networks:
dokploy-network:
external: true