Files
tajniak81andClaude Opus 4.8 2d20f6f29c Bring the Docker setup in line with DriverVault's
The combined stack now includes PocketBase as a first-class service instead
of assuming an external one: a Docker/pocketbase image built from the release
binary that bundles the pb_migrations and upserts the superuser on boot, so a
fresh stack checks/creates its collections and super-admin the same way
DriverVault does. Add production compose variants (registry images) and
.env(.prod).example files for both Docker/ and Docker AIO/, a top-level compose
name, a PocketBase healthcheck with a service_healthy dependency, and
env-driven ports. Move the containerized PocketBase to :8070 (the live remote
PB stays 10.2.1.10:8026). Add a root .dockerignore to trim the repo-root build
context used by the pocketbase and AIO images.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 19:16:21 +02:00

20 lines
955 B
Bash

#!/bin/sh
set -e
# Create/update the superuser from env vars so the API Server can authenticate on
# first boot. `superuser upsert` is idempotent (PocketBase v0.22+/v0.23). Accepts
# either the PilotVault names (POCKETBASE_ADMIN_*) or the short PB_ADMIN_* aliases.
ADMIN_EMAIL="${POCKETBASE_ADMIN_EMAIL:-$PB_ADMIN_EMAIL}"
ADMIN_PASSWORD="${POCKETBASE_ADMIN_PASSWORD:-$PB_ADMIN_PASSWORD}"
if [ -n "$ADMIN_EMAIL" ] && [ -n "$ADMIN_PASSWORD" ]; then
echo "Ensuring PocketBase superuser $ADMIN_EMAIL exists..."
/pb/pocketbase superuser upsert "$ADMIN_EMAIL" "$ADMIN_PASSWORD" \
|| echo "warning: superuser upsert failed; create an admin via the UI at /_/"
fi
# Serve. --migrationsDir applies the bundled JS migrations on boot, which
# create/reconcile every collection and seed the baseline org + accounts
# (including superadmin@pilotvault.local) — all idempotent.
exec /pb/pocketbase serve --http=0.0.0.0:8070 --migrationsDir=/pb/pb_migrations