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:8070/_/). - "${PB_PORT:-8070}:8070" healthcheck: test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8070/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: API_ADDR: ":8080" # Reach PocketBase by its service name on the internal network. POCKETBASE_URL: "http://pocketbase:8070" POCKETBASE_ADMIN_EMAIL: "${PB_ADMIN_EMAIL}" POCKETBASE_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:8090}" AUTH_USERS_COLLECTION: "${AUTH_USERS_COLLECTION:-users}" # OCPP charger control (Anker Solix). Chargers are rejected unless they # connect over TLS; set OCPP_REQUIRE_TLS=false in .env only when TLS is # terminated in front of this stack or for local dev on a trusted network. OCPP_REQUIRE_TLS: "${OCPP_REQUIRE_TLS:-true}" OCPP_PUBLIC_URL: "${OCPP_PUBLIC_URL:-}" 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. Chargers # dialling /ocpp/{serial} also arrive here. - "${API_PORT:-8080}:8080" volumes: # plugins.json + the .env the panel writes back — see the API Server # Dockerfile. Without this, plugin state is lost when the container is # recreated. - api_data:/data 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:-8090}:8090" volumes: pb_data: api_data: