docker: Align compose healthcheck with admin port
Format / gofmt (push) Successful in 18s
Format / gofmt (pull_request) Successful in 19s
CI / Build (push) Successful in 27s
CI / Build (pull_request) Successful in 29s
CI / Go Tests (push) Successful in 1m1s
CI / Go Tests (pull_request) Successful in 1m3s

The compose healthcheck probes http://127.0.0.1:81/api, but the binary
defaults ADMIN_PORT to 8081, so a stock compose up never becomes healthy.

Set ADMIN_PORT, PROXY_HTTP_PORT, and PROXY_HTTPS_PORT in compose so the
process listens on the Dockerfile EXPOSE ports. Document real binary
defaults in the README and keep the Docker section on 80/81/443 via env.

Link: #10
This commit is contained in:
Ash
2026-09-02 16:27:42 +00:00
parent 6615cc218e
commit 06d47e5f07
2 changed files with 23 additions and 13 deletions
+12 -8
View File
@@ -12,14 +12,18 @@ services:
- ./data:/app/data
# user: "0:0" # required when using PUID/PGID != built-in to allow binary to chown+drop
# working_dir: /app # binary uses CWD for relative data/ + data/www/
# environment:
# - JWT_SECRET= # optional; otherwise a random secret is stored in data/.jwt_secret
# - DATA_DIR=/app/data
# - WWW_DIR=/app/data/www
# - PUID=1000
# - PGID=1000
# - DISABLE_IPV6=1
# # PUID_NO_DROP=1 # if using low ports (80/443) + PUID: chown as root but skip drop (stay root for bind; default drop runs as PUID after, requires high ports or NET_BIND_SERVICE cap)
environment:
- ADMIN_PORT=81
- PROXY_HTTP_PORT=80
- PROXY_HTTPS_PORT=443
# ADMIN_HOST defaults to 127.0.0.1 (healthcheck hits 127.0.0.1:81)
# - JWT_SECRET= # optional; otherwise a random secret is stored in data/.jwt_secret
# - DATA_DIR=/app/data
# - WWW_DIR=/app/data/www
# - PUID=1000
# - PGID=1000
# - DISABLE_IPV6=1
# # PUID_NO_DROP=1 # if using low ports (80/443) + PUID: chown as root but skip drop (stay root for bind; default drop runs as PUID after, requires high ports or NET_BIND_SERVICE cap)
# To use optional SQL backend instead of default yaml:
# - DB_TYPE=postgres
# - DB_POSTGRES_HOST=db