Refresh docs and fix Docker builds for current layout

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>
This commit is contained in:
tajniak81andClaude Opus 4.8 committed 2026-07-19 11:05:46 +02:00
1 parent f9b1bcc520
commit 1e76c2b7f9
15 files changed
+301 -138

No files matched your search

+19 -18
View File
@@ -5,42 +5,43 @@
# The build context MUST be the project root so this file can reach both
# "API Server/" and "Web App/". Build it with:
#
# docker build -f "Docker AIO/Dockerfile" -t carcontrol-aio .
# docker build -f "Docker AIO/Dockerfile" -t drivervault-aio .
#
# Run it (all three services start together):
#
# docker run -d --name carcontrol -p 80:80 -p 8090:8090 \
# docker run -d --name drivervault -p 80:80 -p 8090:8090 \
# -e PB_ADMIN_EMAIL=admin@example.com \
# -e PB_ADMIN_PASSWORD=change-me \
# -e AUTH_SECRET=$(openssl rand -hex 32) \
# -v carcontrol_pb:/pb/pb_data \
# carcontrol-aio
# -v drivervault_pb:/pb/pb_data \
# drivervault-aio
#
# Then: web app on http://host/ and PocketBase admin on http://host:8090/_/
# --- Stage 1: build the Go API Server ---------------------------------------
FROM golang:1.22-alpine AS api-build
FROM golang:1.26-alpine AS api-build
WORKDIR /src
COPY ["API Server/go.mod", "./"]
COPY ["API Server/go.su[m]", "./"]
RUN go mod download
# Only main.go + internal are needed; the panel is already built into
# internal/api/dist and embedded via //go:embed.
COPY ["API Server/main.go", "./"]
# Only cmd/ + internal are needed; the panel is already built into
# internal/api/dist and embedded via //go:embed. Entry point is cmd/server.
COPY ["API Server/cmd", "./cmd"]
COPY ["API Server/internal", "./internal"]
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/api-server .
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/api-server ./cmd/server
# --- Stage 2: build the Vue Web App -----------------------------------------
# The Vue source lives under "Web App/web/".
FROM node:22-alpine AS web-build
WORKDIR /app
COPY ["Web App/package.json", "Web App/package-lock.json", "./"]
COPY ["Web App/web/package.json", "Web App/web/package-lock.json", "./"]
RUN npm ci
COPY ["Web App/index.html", "Web App/vite.config.js", "./"]
COPY ["Web App/src", "./src"]
COPY ["Web App/public", "./public"]
COPY ["Web App/web/index.html", "Web App/web/vite.config.js", "./"]
COPY ["Web App/web/src", "./src"]
COPY ["Web App/web/public", "./public"]
# Empty -> bundle uses same-origin "/api", proxied to the API Server by nginx.
ARG VITE_API_BASE
RUN npm run build
# vite.config writes to ../server/dist by default; emit into ./dist here.
RUN npm run build -- --outDir dist --emptyOutDir
# --- Stage 3: runtime (all services) ----------------------------------------
FROM alpine:latest
@@ -148,11 +149,11 @@ SUPERVISOR
# API Server config: everything is local to this container.
ENV PORT=8080 \
PB_URL=http://127.0.0.1:8090 \
CORS_ORIGINS=http://localhost \
CORS_ALLOW_ORIGINS=http://localhost \
AUTH_USERS_COLLECTION=users
# Required at runtime (no safe defaults): PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD,
# AUTH_SECRET. Pass them with `docker run -e ...`.
# Required at runtime (no safe defaults): PB_ADMIN_EMAIL, PB_ADMIN_PASSWORD.
# Pass them with `docker run -e ...`.
VOLUME /pb/pb_data
# 80 = Web App, 8090 = PocketBase admin, 8080 = API Server + embedded API panel.