Support subpath
All checks were successful
CI / Backend tests (push) Successful in 30s
CI / Frontend lint (push) Successful in 33s
CI / Frontend build (push) Successful in 25s
CI / Frontend unit tests (push) Successful in 1m6s
CI / Playwright e2e (push) Successful in 1m43s
Docker / build-and-push (push) Successful in 2m30s

This commit is contained in:
Andras Schmelczer 2026-05-31 20:27:41 +01:00
commit a48aad974a
6 changed files with 50 additions and 9 deletions

View file

@ -1,10 +1,16 @@
# Stage 1: SPA build
FROM node:22-alpine AS spa-build
WORKDIR /build
# Sub-path the SPA is served under, e.g. "/towers/" for https://schmelczer.dev/towers/.
# Defaults to "/" so local/dev/e2e builds (served at the container root) work
# unchanged. The production image (see .forgejo/workflows/docker.yml) overrides
# this. The trailing slash matters — it becomes <base href> and the service
# worker (ngsw.json) URL prefix.
ARG BASE_HREF=/
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
RUN npm run build -- --base-href="$BASE_HREF"
# Angular's application builder outputs to dist/frontend/browser/
# Stage 2: runtime