Introduce registry-pull production stacks (docker-compose.prod.yml) for both the multi-container Docker setup and the all-in-one Docker AIO image, with everything an operator needs (superuser, super-admin, ports, volumes) driven from .env. The API Server now bootstraps PocketBase on startup: a new internal/bootstrap package (Go port of setup-pocketbase.mjs) creates missing collections, reconciles existing ones, and creates the DriverVault super-admin from DRIVERVAULT_SUPERADMIN_* when absent. Idempotent and gated by PB_BOOTSTRAP. The PocketBase superuser is still upserted by the PocketBase container, since the REST API cannot bootstrap the first superuser. Move PocketBase to port 8070 (internal + published) and the web app to 8090 across both stacks, with matching CORS defaults. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
42 lines
1.8 KiB
YAML
42 lines
1.8 KiB
YAML
name: drivervault-aio
|
|
|
|
# Single all-in-one container: PocketBase + API Server + Web App (nginx).
|
|
# The build context is the project root so the Dockerfile can reach both
|
|
# "API Server/" and "Web App/". Copy .env.example to .env before starting.
|
|
|
|
services:
|
|
drivervault:
|
|
build:
|
|
# Project root (one level up from this compose file).
|
|
context: ..
|
|
dockerfile: Docker AIO/Dockerfile
|
|
args:
|
|
# Empty -> bundle uses same-origin "/api", proxied internally by nginx.
|
|
VITE_API_BASE: "${VITE_API_BASE:-}"
|
|
# Optional: pin PocketBase; empty fetches the latest release at build.
|
|
PB_VERSION: "${PB_VERSION:-}"
|
|
image: drivervault-aio
|
|
container_name: drivervault-aio
|
|
restart: unless-stopped
|
|
environment:
|
|
# Superuser (also used by the API Server to authenticate to PocketBase).
|
|
PB_ADMIN_EMAIL: "${PB_ADMIN_EMAIL:?set PB_ADMIN_EMAIL in .env}"
|
|
PB_ADMIN_PASSWORD: "${PB_ADMIN_PASSWORD:?set PB_ADMIN_PASSWORD in .env}"
|
|
# Match CORS to the web origin (only used if a browser calls the API directly).
|
|
CORS_ALLOW_ORIGINS: "${CORS_ALLOW_ORIGINS:-http://localhost:8090}"
|
|
# Schema + super-admin bootstrap on boot (idempotent). Set PB_BOOTSTRAP=false
|
|
# to skip once the database is established.
|
|
PB_BOOTSTRAP: "${PB_BOOTSTRAP:-true}"
|
|
DRIVERVAULT_SUPERADMIN_EMAIL: "${DRIVERVAULT_SUPERADMIN_EMAIL:-}"
|
|
DRIVERVAULT_SUPERADMIN_PASSWORD: "${DRIVERVAULT_SUPERADMIN_PASSWORD:-}"
|
|
DRIVERVAULT_SUPERADMIN_NAME: "${DRIVERVAULT_SUPERADMIN_NAME:-Administrator}"
|
|
ports:
|
|
- "${WEB_PORT:-8090}:80" # Web App
|
|
- "${PB_PORT:-8070}:8070" # PocketBase admin UI / API
|
|
- "${API_PORT:-8080}:8080" # API Server + embedded API web panel (root /)
|
|
volumes:
|
|
- pb_data:/pb/pb_data
|
|
|
|
volumes:
|
|
pb_data:
|