Make the app's port configurable with PORT (default 8080)

compose.yaml passes ${PORT:-8080} to the app, its healthcheck and the
standalone Caddy (APP_PORT in the Caddyfile). Docs note that the panel's
domain must target the same port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013FYo6JSV1fDU1fm3LU77iF
This commit is contained in:
agent 2026-10-09 22:49:54 +00:00
parent 9cd4c82118
commit 0217d62bf0
5 changed files with 18 additions and 10 deletions

View file

@ -2,7 +2,8 @@
# overridden with an environment variable (in the panel's Environment tab,
# or in a .env file next to this file).
#
# With the panel: point the app's domain at service `app`, port 8080.
# With the panel: point the app's domain at service `app`, port $PORT
# (8080 unless you set PORT).
# The panel's Caddy provides HTTPS.
# Standalone (no panel): set DOMAIN and run
# podman compose --profile standalone up -d --build
@ -34,19 +35,21 @@ services:
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
# 1 = turn push notifications off.
PUSH_DISABLED: ${PUSH_DISABLED:-0}
# Port the app listens on inside the container. If you change it,
# point the panel's domain at the new port too.
PORT: ${PORT:-8080}
# Fixed for the container; no need to change these.
HOST: 0.0.0.0
PORT: "8080"
DATA_DIR: /data
STATIC_DIR: /app/web
TRUST_PROXY: "1"
volumes:
- oweme-data:/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/api/health"]
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:${PORT:-8080}/api/health"]
interval: 30s
timeout: 5s
# No ports: the panel publishes 8080 for its routes; standalone, only
# No ports: the panel publishes $PORT for its routes; standalone, only
# Caddy reaches the app.
caddy:
@ -58,6 +61,8 @@ services:
environment:
# Public hostname for standalone HTTPS (needs a DNS record).
DOMAIN: ${DOMAIN:-localhost}
# Where Caddy finds the app (same as the app's PORT).
APP_PORT: ${PORT:-8080}
ports:
# Rootless Podman can't bind ports below 1024 by default; see
# deploy/README.md "Ports".