Move the dashboard and setup pages to a Vue SPA
The pages are now a Vue 3 + Vite + TypeScript app in web/, built into internal/web/dist/app and embedded in the binary. Go still serves index.html for / and /setup behind the admin gate, plus the hashed /assets/* (public, cached forever). The router takes its base from the current URL, so it works under nginx's /tracker/ prefix unchanged. Only dist/.gitkeep is committed, so go build and go test need no Node; an unbuilt binary shows a "run make web" page at /. The Dockerfile gains a Node stage, CI typechecks and builds the app, and make build/run build it first. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
+10
-1
@@ -1,13 +1,22 @@
|
||||
# Build from the repo root: docker build -f deploy/Dockerfile -t activity-tracker .
|
||||
#
|
||||
# Multi-arch by construction: both base images are published for arm64, and
|
||||
# Multi-arch by construction: all the base images are published for arm64, and
|
||||
# the Pi's CI (.gitea/workflows/ci.yaml) builds natively there. No
|
||||
# `RUN --mount` cache lines, so it also builds on the Pi's legacy builder.
|
||||
FROM node:24-alpine AS web
|
||||
WORKDIR /src/web
|
||||
COPY web/package.json web/package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY web/ ./
|
||||
# Writes ../internal/web/dist/app, which the Go build embeds.
|
||||
RUN npm run build
|
||||
|
||||
FROM golang:1.27 AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
COPY --from=web /src/internal/web/dist/app internal/web/dist/app
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/tracker ./cmd/tracker
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot
|
||||
|
||||
Reference in New Issue
Block a user