Files
pokeshare/pocketbase/entrypoint.sh
T
nlevesque 3d712b8c57 Add self-hosted PocketBase stack with auto-migrations
- docker-compose.yml: app + pocketbase services (PB internal to the network)
- pocketbase/: pinned PocketBase image, superuser bootstrap via env vars
- pb_migrations: production schema (collections, rules, public_users view)
  applied automatically on first boot
- pocketbase/pb_schema.json: schema export kept as reference
- README: full-stack deployment docs
2026-07-28 09:38:07 +02:00

13 lines
486 B
Bash

#!/bin/sh
set -e
# Optionally create/update the admin (superuser) account on boot.
# Set PB_SUPERUSER_EMAIL and PB_SUPERUSER_PASSWORD as env vars to enable.
# The password must be at least 8 characters.
if [ -n "$PB_SUPERUSER_EMAIL" ] && [ -n "$PB_SUPERUSER_PASSWORD" ]; then
./pocketbase superuser upsert "$PB_SUPERUSER_EMAIL" "$PB_SUPERUSER_PASSWORD" || true
fi
# `serve` automatically applies pending migrations from ./pb_migrations
exec ./pocketbase serve --http=0.0.0.0:8090