build(portal-frontend): add Dockerfile and SPA nginx config

Multi-stage: node build with --base-href=/portal/, then nginx:alpine
serving the compiled dist with try_files SPA fallback for client-side
routes (e.g. a direct hit on /legacy/1001). Verified standalone: root
and a deep link both 200, base href correct.
This commit is contained in:
eho
2026-07-31 09:13:08 +02:00
parent c2d0ba9a3d
commit 8a192578fa
2 changed files with 19 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM node:22-alpine AS build
WORKDIR /src
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npx ng build --configuration production --base-href=/portal/
FROM nginx:alpine AS runtime
COPY --from=build /src/dist/portal-frontend/browser /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
+8
View File
@@ -0,0 +1,8 @@
server {
listen 80;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
}
}