Compose: configurable public URL scheme/port (fixes login behind HTTPS)

ORIGIN, PUBLIC_POCKETBASE_URL and PUBLIC_SITE_URL were hard-coded to
http://<sub>.${DOMAIN}:8080. Behind a TLS reverse proxy the browser's
origin is https://<sub>.<domain>, so SvelteKit rejected the admin login
form ("Cross-site POST form submissions are forbidden") and image URLs
pointed at an unreachable port. URL_SCHEME / URL_PORT now build them
(defaults unchanged). Two flat variables because podman-compose 1.5 does
not support nested ${A:-${B}} defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
This commit is contained in:
agent 2026-10-07 14:37:28 +00:00
parent 9fab662bee
commit 7b6c8c2511
4 changed files with 33 additions and 8 deletions

View file

@ -38,6 +38,17 @@ The project runs exclusively through Docker Compose. There is no bare host dev m
Caddy's `.localhost` handling works without DNS or hosts-file changes. Source changes require rebuilding (`docker compose up --build`); the containers run the production build (`node build`), not a dev server.
**Deploying behind HTTPS** (e.g. another reverse proxy terminating TLS and forwarding to `:8080`): the apps must know the URL the browser really uses, or the admin login fails with *"Cross-site POST form submissions are forbidden"*. In `.env`:
```sh
DOMAIN=example.com # → admin.example.com, www.example.com, db.example.com
URL_SCHEME=https
URL_PORT= # empty: no port in the URL
CADDY_SCHEME=http # this stack's Caddy stays plain HTTP behind the TLS proxy
```
Then `docker compose up -d` (no rebuild needed: these are runtime env vars).
## Docker Compose
Run the full stack: