READMEs: correct the auth model (PocketBase token relay, not JWT/sessions), document the full feature set (technical checks, fuel, maintenance, documents, reminders, attachments, integrations, OCPP charging control), the shipping built-in connectors (toyota, anker-solix), and the current endpoint surface. Docker: build against the current repo layout — Go 1.26, cmd/server entry point, Web App source under web/. Add the missing Web App Dockerfile (Go BFF) and .dockerignore, drop the obsolete AUTH_SECRET, modernise CORS var naming, and standardise on drivervault-* naming. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
73 lines
2.4 KiB
YAML
73 lines
2.4 KiB
YAML
name: drivervault
|
|
|
|
# Full DriverVault stack: PocketBase (database) + API Server + Web App.
|
|
# Traffic flow (browser): Web App BFF --/api--> API Server --> PocketBase.
|
|
# Copy .env.example to .env and fill in the secrets before `docker compose up`.
|
|
|
|
services:
|
|
pocketbase:
|
|
build:
|
|
context: ./pocketbase
|
|
image: drivervault-pocketbase
|
|
container_name: drivervault-pocketbase
|
|
restart: unless-stopped
|
|
environment:
|
|
# Superuser is created/updated on boot so the API Server can authenticate.
|
|
PB_ADMIN_EMAIL: "${PB_ADMIN_EMAIL:?set PB_ADMIN_EMAIL in .env}"
|
|
PB_ADMIN_PASSWORD: "${PB_ADMIN_PASSWORD:?set PB_ADMIN_PASSWORD in .env}"
|
|
volumes:
|
|
- pb_data:/pb/pb_data
|
|
ports:
|
|
# Admin UI / API exposed on the host for management (http://host:8090/_/).
|
|
- "${PB_PORT:-8090}:8090"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8090/api/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 12
|
|
start_period: 10s
|
|
|
|
api-server:
|
|
build:
|
|
context: ../API Server
|
|
image: drivervault-api
|
|
container_name: drivervault-api
|
|
restart: unless-stopped
|
|
depends_on:
|
|
pocketbase:
|
|
condition: service_healthy
|
|
environment:
|
|
PORT: "8080"
|
|
# Reach PocketBase by its service name on the internal network.
|
|
PB_URL: "http://pocketbase:8090"
|
|
PB_ADMIN_EMAIL: "${PB_ADMIN_EMAIL}"
|
|
PB_ADMIN_PASSWORD: "${PB_ADMIN_PASSWORD}"
|
|
# Same-origin requests go through the Web App BFF, so CORS is only needed
|
|
# if the browser ever calls the API Server directly. Default to the web origin.
|
|
CORS_ALLOW_ORIGINS: "${CORS_ALLOW_ORIGINS:-http://localhost:8081}"
|
|
AUTH_USERS_COLLECTION: "${AUTH_USERS_COLLECTION:-users}"
|
|
ports:
|
|
# Optional direct access to the API Server (and its panel at /); the Web
|
|
# App reaches it over the internal network, not this host port.
|
|
- "${API_PORT:-8080}:8080"
|
|
|
|
web-app:
|
|
build:
|
|
context: ../Web App
|
|
args:
|
|
# Empty -> bundle uses same-origin "/api", which the BFF proxies below.
|
|
VITE_API_BASE: "${VITE_API_BASE:-}"
|
|
image: drivervault-web
|
|
container_name: drivervault-web
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- api-server
|
|
environment:
|
|
# The BFF reverse-proxies /api/* to the API Server over the internal network.
|
|
API_BASE: "http://api-server:8080"
|
|
ports:
|
|
- "${WEB_PORT:-8081}:8090"
|
|
|
|
volumes:
|
|
pb_data:
|