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>
This commit is contained in:
1 parent
11fb1e060d
commit
2d20f6f29c
13 files changed
+401
-32
No files matched your search
@@ -0,0 +1,21 @@
|
||||
# Copy to .env and fill in. Used by the Docker AIO docker-compose.yml.
|
||||
|
||||
# --- PocketBase superuser (also used by the API Server to authenticate) ------
|
||||
POCKETBASE_ADMIN_EMAIL=admin@dji.local
|
||||
POCKETBASE_ADMIN_PASSWORD=djiadmin2026!
|
||||
|
||||
# The app super-admin login (superadmin@pilotvault.local) is created by the
|
||||
# bundled PocketBase migrations on first boot.
|
||||
|
||||
# Allowed CORS origin(s) — "*" is convenient for a local demo.
|
||||
CORS_ALLOW_ORIGINS=*
|
||||
|
||||
# --- Host port mappings (optional; defaults shown) --------------------------
|
||||
WEB_PORT=8090
|
||||
API_PORT=8080
|
||||
PB_PORT=8070
|
||||
|
||||
# --- Storage ----------------------------------------------------------------
|
||||
# Docker-managed named volume by default; set PB_DATA to an absolute host path
|
||||
# for a bind mount, e.g. PB_DATA=/srv/pilotvault/pb_data
|
||||
PB_DATA=pb_data
|
||||
@@ -0,0 +1,28 @@
|
||||
# PilotVault all-in-one — production config.
|
||||
# Copy to .env and fill in, then:
|
||||
# docker compose -f docker-compose.prod.yml pull
|
||||
# docker compose -f docker-compose.prod.yml up -d
|
||||
|
||||
# --- Registry image ---------------------------------------------------------
|
||||
AIO_IMAGE=10.2.1.10:5500/admin/pilotvault-aio:latest
|
||||
|
||||
# --- PocketBase superuser (required) ----------------------------------------
|
||||
# Created/updated on first boot. The API Server uses these to manage the database.
|
||||
POCKETBASE_ADMIN_EMAIL=admin@dji.local
|
||||
POCKETBASE_ADMIN_PASSWORD=change-me-long-password
|
||||
|
||||
# The app super-admin login (superadmin@pilotvault.local) is created by the
|
||||
# bundled PocketBase migrations on first boot.
|
||||
|
||||
# Allowed CORS origin(s) — match your public web URL / WEB_PORT.
|
||||
CORS_ALLOW_ORIGINS=http://localhost:8090
|
||||
|
||||
# --- Host port mappings (optional; defaults shown) --------------------------
|
||||
WEB_PORT=8090
|
||||
API_PORT=8080
|
||||
PB_PORT=8070
|
||||
|
||||
# --- Storage ----------------------------------------------------------------
|
||||
# Default is a Docker-managed named volume ("pb_data"). Set PB_DATA to an
|
||||
# absolute host path for a bind mount, e.g. PB_DATA=/srv/pilotvault/pb_data
|
||||
PB_DATA=pb_data
|
||||
@@ -8,10 +8,10 @@
|
||||
# and "Web App/"). From E:\VS Code Projects\PilotVault run:
|
||||
#
|
||||
# docker build -f "Docker AIO/Dockerfile" -t pilotvault-aio .
|
||||
# docker run -p 8090:8090 -p 8080:8080 -p 8026:8026 \
|
||||
# docker run -p 8090:8090 -p 8080:8080 -p 8070:8070 \
|
||||
# -v pilotvault_pb:/pb/pb_data pilotvault-aio
|
||||
#
|
||||
# Internal ports (loopback-wired): PocketBase 8026, API Server 8080, Web App 8090.
|
||||
# Internal ports (loopback-wired): PocketBase 8070, API Server 8080, Web App 8090.
|
||||
|
||||
# =============================================================================
|
||||
# Stage 1 — build the API Server's embedded Vue panel (-> internal/api/dist)
|
||||
@@ -91,7 +91,7 @@ COPY ["API Server/pocketbase/pb_migrations/", "/pb/pb_migrations/"]
|
||||
# Web App reads ADDR / API_BASE
|
||||
# NOTE: these bundle default credentials for convenience — override at `docker run`.
|
||||
ENV API_ADDR=":8080" \
|
||||
POCKETBASE_URL="http://127.0.0.1:8026" \
|
||||
POCKETBASE_URL="http://127.0.0.1:8070" \
|
||||
CORS_ALLOW_ORIGINS="*" \
|
||||
POCKETBASE_ADMIN_EMAIL="admin@dji.local" \
|
||||
POCKETBASE_ADMIN_PASSWORD="djiadmin2026!" \
|
||||
@@ -111,7 +111,7 @@ pidfile=/run/supervisord.pid
|
||||
priority=10
|
||||
directory=/pb
|
||||
# Ensure the service-account superuser exists, then serve on the internal port.
|
||||
command=/bin/sh -c "/app/pocketbase superuser upsert \"$POCKETBASE_ADMIN_EMAIL\" \"$POCKETBASE_ADMIN_PASSWORD\" --dir=/pb/pb_data ; exec /app/pocketbase serve --http=0.0.0.0:8026 --dir=/pb/pb_data --migrationsDir=/pb/pb_migrations"
|
||||
command=/bin/sh -c "/app/pocketbase superuser upsert \"$POCKETBASE_ADMIN_EMAIL\" \"$POCKETBASE_ADMIN_PASSWORD\" --dir=/pb/pb_data ; exec /app/pocketbase serve --http=0.0.0.0:8070 --dir=/pb/pb_data --migrationsDir=/pb/pb_migrations"
|
||||
autorestart=true
|
||||
startsecs=3
|
||||
stdout_logfile=/dev/stdout
|
||||
@@ -145,6 +145,6 @@ EOF
|
||||
# PocketBase data (SQLite). Mount a volume here to persist across restarts.
|
||||
VOLUME ["/pb/pb_data"]
|
||||
|
||||
EXPOSE 8090 8080 8026
|
||||
EXPOSE 8090 8080 8070
|
||||
|
||||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]
|
||||
@@ -0,0 +1,34 @@
|
||||
name: pilotvault-aio
|
||||
|
||||
# Production all-in-one — pulls the prebuilt image from the registry instead of
|
||||
# building. One container runs PocketBase + API Server + Web App. Everything an
|
||||
# operator needs to set lives in .env.
|
||||
#
|
||||
# 1. cp .env.prod.example .env (then edit it)
|
||||
# 2. docker compose -f docker-compose.prod.yml pull
|
||||
# 3. docker compose -f docker-compose.prod.yml up -d
|
||||
#
|
||||
# On first boot the bundled PocketBase upserts its superuser from
|
||||
# POCKETBASE_ADMIN_* and runs the JS migrations, which create/reconcile every
|
||||
# collection and seed the baseline org + accounts (incl. superadmin@pilotvault.local).
|
||||
# Idempotent, so restarts and upgrades are safe.
|
||||
|
||||
services:
|
||||
pilotvault:
|
||||
image: "${AIO_IMAGE:-10.2.1.10:5500/admin/pilotvault-aio:latest}"
|
||||
container_name: pilotvault-aio
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POCKETBASE_ADMIN_EMAIL: "${POCKETBASE_ADMIN_EMAIL:?set POCKETBASE_ADMIN_EMAIL in .env}"
|
||||
POCKETBASE_ADMIN_PASSWORD: "${POCKETBASE_ADMIN_PASSWORD:?set POCKETBASE_ADMIN_PASSWORD in .env}"
|
||||
CORS_ALLOW_ORIGINS: "${CORS_ALLOW_ORIGINS:-http://localhost:8090}"
|
||||
ports:
|
||||
- "${WEB_PORT:-8090}:8090" # Web App (control panel)
|
||||
- "${API_PORT:-8080}:8080" # API Server + embedded API web panel (root /)
|
||||
- "${PB_PORT:-8070}:8070" # PocketBase admin UI / API
|
||||
volumes:
|
||||
# Named volume by default; set PB_DATA to a host path in .env for a bind mount.
|
||||
- "${PB_DATA:-pb_data}:/pb/pb_data"
|
||||
|
||||
volumes:
|
||||
pb_data:
|
||||
@@ -1,7 +1,17 @@
|
||||
name: pilotvault-aio
|
||||
|
||||
# All-in-one PilotVault stack (PocketBase + API Server + Web App) in ONE container.
|
||||
# Run from this Docker AIO/ folder: docker compose up --build
|
||||
# Run from this Docker AIO/ folder:
|
||||
#
|
||||
# cp .env.example .env # then edit the credentials/ports
|
||||
# docker compose up --build
|
||||
#
|
||||
# The build context is the repo root (..) because the Dockerfile COPYs from
|
||||
# "API Server/" and "Web App/".
|
||||
#
|
||||
# On first boot the bundled PocketBase upserts its superuser from
|
||||
# POCKETBASE_ADMIN_* and runs the JS migrations, which create/reconcile every
|
||||
# collection and seed the baseline org + accounts (incl. superadmin@pilotvault.local).
|
||||
|
||||
services:
|
||||
pilotvault:
|
||||
@@ -13,19 +23,20 @@ services:
|
||||
# PB_ARCH: "amd64" # use "arm64" on Apple Silicon
|
||||
image: pilotvault-aio
|
||||
container_name: pilotvault-aio
|
||||
ports:
|
||||
- "8090:8090" # Web App (control panel)
|
||||
- "8080:8080" # API Server
|
||||
- "8026:8026" # PocketBase
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
# Loopback-wired between the three in-container services. Override the
|
||||
# bundled default credentials here for anything real.
|
||||
POCKETBASE_ADMIN_EMAIL: "admin@dji.local"
|
||||
POCKETBASE_ADMIN_PASSWORD: "djiadmin2026!"
|
||||
CORS_ALLOW_ORIGINS: "*"
|
||||
POCKETBASE_ADMIN_EMAIL: "${POCKETBASE_ADMIN_EMAIL:-admin@dji.local}"
|
||||
POCKETBASE_ADMIN_PASSWORD: "${POCKETBASE_ADMIN_PASSWORD:-djiadmin2026!}"
|
||||
CORS_ALLOW_ORIGINS: "${CORS_ALLOW_ORIGINS:-*}"
|
||||
ports:
|
||||
- "${WEB_PORT:-8090}:8090" # Web App (control panel)
|
||||
- "${API_PORT:-8080}:8080" # API Server
|
||||
- "${PB_PORT:-8070}:8070" # PocketBase admin UI / API
|
||||
volumes:
|
||||
- pb_data:/pb/pb_data # persist PocketBase SQLite across restarts
|
||||
restart: unless-stopped
|
||||
# Named volume by default; set PB_DATA to a host path in .env for a bind mount.
|
||||
- "${PB_DATA:-pb_data}:/pb/pb_data"
|
||||
|
||||
volumes:
|
||||
pb_data:
|
||||
Reference in new issue
Block a user