domaino/Caddyfile
agent d62799f263 PocketBase: switch image to elestio/pocketbase v0.23.12
spectado/pocketbase has been removed from Docker Hub. elestio publishes
the same PocketBase version (0.23.12), so schema, migrations and hooks
are unchanged. The image differs in packaging:

- listens on 8090 instead of 80 (Caddyfile, POCKETBASE_INTERNAL_URL)
- runs as non-root user `pocketbase` (uid 100), so pb_data written by
  the old root-run image needs a one-off chown; README documents it
- pinned by digest as well as tag

Tested: copy of an existing pb_data volume, README chown command via
podman-compose, then the full stack (public page renders, admin and db
routes via Caddy, shop hooks respond). A fresh volume also works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HA82gX7xH4zwYTr5vE7mf8
2026-11-03 09:10:16 +00:00

26 lines
1.1 KiB
Caddyfile

# Reverse proxy — subdomain-based routing on port 8080
# admin.{$DOMAIN} → app-admin (SvelteKit admin app)
# db.{$DOMAIN} → PocketBase (redirects / to /_/)
# *.{$DOMAIN} → app-public (SvelteKit public app)
#
# The scheme is controlled by the {$CADDY_SCHEME} env var (default: http).
# - http → plain HTTP (disables Caddy's automatic HTTPS). Matches the ORIGIN
# env vars in docker-compose.yml (http://admin.${DOMAIN}:8080 etc.)
# so SvelteKit's CSRF protection accepts form POSTs.
# - https → HTTPS. On a non-standard port (8080) Caddy will issue internal
# self-signed certificates unless you configure a real cert issuer.
# Remember to also update ORIGIN/PUBLIC_* URLs in docker-compose.yml.
{$CADDY_SCHEME}://admin.{$DOMAIN}:8080 {
reverse_proxy app-admin:3001
}
{$CADDY_SCHEME}://db.{$DOMAIN}:8080 {
# PocketBase admin UI lives at /_/ — redirect bare root there.
redir / /_/{path}
reverse_proxy pocketbase:8090
}
{$CADDY_SCHEME}://www.{$DOMAIN}:8080, {$CADDY_SCHEME}://*.{$DOMAIN}:8080 {
reverse_proxy app-public:3000
}