domaino/docker-compose.yml
agent 5e2db31b5e PocketBase 0.40.6, JS SDK 0.28.2; fresh-install steps for the new dashboard
- docker-compose: elestio/pocketbase v0.40.6, digest-pinned (same port,
  user and layout as v0.23.12)
- pocketbase SDK ^0.28.2 in both apps and packages/shared (0.27/0.28
  are additions and pb.filter() fixes, nothing breaking)
- README: setup steps rewritten for the 0.40 dashboard: install link
  from the log, and tick "Merge with the existing collections" on
  schema import (the default deletes `users`); an upgrade section
  (back up first, data upgrade is one-way, what changed)
- AGENTS.md: versions; field settings go at the top level, not `options`

Compared with main (0.23.12 + SDK 0.26) on copies of real data: admin
and public page text, image upload, import of all three backups, the
shop flow via hooks, Stripe webhook signatures, and a fresh install
with pb_schema.json import all behave the same.

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

112 lines
4.6 KiB
YAML

services:
pocketbase:
# Pinned: schema (pb_schema.json) and migrations target this version's
# format/JS API. Upgrade deliberately — read the PocketBase changelog,
# back up pb_data, then bump the tag and test migrations locally.
# Digest-pinned too, so a re-pushed tag can't change what runs.
# This image runs as a non-root `pocketbase` user (uid 100) on port 8090
# and finds /pb_migrations and /pb_hooks next to /pb_data by default.
# Data written by the old root-run image (spectado/pocketbase, now gone)
# must be chown'ed once — see the README's "Switching PocketBase image".
image: docker.io/elestio/pocketbase:v0.40.6@sha256:936756ccefb13cedaf2e7c49745412455bc81f2d1a511132f4012e411b970437
container_name: massage-pocketbase
restart: unless-stopped
# Internal only — accessed via the caddy reverse proxy
expose:
- "8090"
volumes:
- pocketbase:/pb_data
# Versioned schema changes; PocketBase applies pending ones on start.
- ./pocketbase/pb_migrations:/pb_migrations:ro,Z
# Shop API (baskets, slot holds, Stripe payments, orders) — the only
# place commerce data is written. See pocketbase/pb_hooks/shop/lib.js.
- ./pocketbase/pb_hooks:/pb_hooks:ro,Z
environment:
STRIPE_SECRET_KEY: ${STRIPE_SECRET_KEY:-}
STRIPE_WEBHOOK_SECRET: ${STRIPE_WEBHOOK_SECRET:-}
STRIPE_CURRENCY: ${STRIPE_CURRENCY:-eur}
# Shared with app-public: lets it record booking-email status on orders.
INTERNAL_API_SECRET: ${INTERNAL_API_SECRET:-}
app-admin:
build:
context: .
dockerfile: app-admin/Dockerfile
container_name: massage-app-admin
restart: unless-stopped
depends_on:
- pocketbase
environment:
PORT: 3001
POCKETBASE_INTERNAL_URL: http://pocketbase:8090
# Browser-facing URLs. They must match the address bar exactly, or
# SvelteKit rejects logins/forms ("Cross-site POST form submissions are
# forbidden"). Behind a TLS proxy: URL_SCHEME=https and URL_PORT= (empty).
PUBLIC_POCKETBASE_URL: ${URL_SCHEME:-http}://db.${DOMAIN:-localhost}${URL_PORT-:8080}
ORIGIN: ${URL_SCHEME:-http}://admin.${DOMAIN:-localhost}${URL_PORT-:8080}
PUBLIC_SITE_URL: ${URL_SCHEME:-http}://www.${DOMAIN:-localhost}${URL_PORT-:8080}
BODY_SIZE_LIMIT: 52428800 # 50MB — import payload embeds all images as base64
STRIPE_CURRENCY: ${STRIPE_CURRENCY:-eur}
# Booking emails (Brevo SMTP relay) — admin needs these for resend/test sends
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASS: ${SMTP_PASS:-}
EMAIL_FROM: ${EMAIL_FROM:-}
EMAIL_FROM_NAME: ${EMAIL_FROM_NAME:-}
SITE_TIMEZONE: ${SITE_TIMEZONE:-Europe/Oslo}
# Internal only — served via the caddy reverse proxy
expose:
- "3001"
app-public:
build:
context: .
dockerfile: app-public/Dockerfile
container_name: massage-app-public
restart: unless-stopped
depends_on:
- pocketbase
environment:
PORT: 3000
POCKETBASE_INTERNAL_URL: http://pocketbase:8090
PUBLIC_POCKETBASE_URL: ${URL_SCHEME:-http}://db.${DOMAIN:-localhost}${URL_PORT-:8080}
ORIGIN: ${URL_SCHEME:-http}://www.${DOMAIN:-localhost}${URL_PORT-:8080}
# No PocketBase or Stripe secrets here: shop writes happen in PocketBase
# (pb_hooks/shop). The publishable key is public by design.
PUBLIC_STRIPE_PUBLISHABLE_KEY: ${PUBLIC_STRIPE_PUBLISHABLE_KEY:-}
STRIPE_CURRENCY: ${STRIPE_CURRENCY:-eur}
INTERNAL_API_SECRET: ${INTERNAL_API_SECRET:-}
# Booking emails (Brevo SMTP relay) — sent from the Stripe webhook
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASS: ${SMTP_PASS:-}
EMAIL_FROM: ${EMAIL_FROM:-}
EMAIL_FROM_NAME: ${EMAIL_FROM_NAME:-}
SITE_TIMEZONE: ${SITE_TIMEZONE:-Europe/Oslo}
# Internal only — served via the caddy reverse proxy
expose:
- "3000"
caddy:
image: docker.io/library/caddy:2-alpine
container_name: massage-caddy
restart: unless-stopped
ports:
- "8080:8080"
environment:
DOMAIN: ${DOMAIN:-localhost}
# Scheme used in Caddyfile site addresses. "http" = plain HTTP on :8080
# (matches the ORIGIN vars below). Switch to "https" only if you also
# update ORIGIN/PUBLIC_* URLs and provide a cert issuer.
CADDY_SCHEME: ${CADDY_SCHEME:-http}
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro,Z
depends_on:
- app-admin
- app-public
- pocketbase
volumes:
pocketbase: