feat: embed frontend into backend server with full-stack build pipeline (RCA-20)
The backend now serves the Vue admin UI as static files with SPA fallback, eliminating the need for a separate web server. Dockerfile builds both frontend and backend in a multi-stage pipeline. Added build:web and build:all scripts, updated CI to verify frontend builds, and fixed vitest config to exclude Playwright tests. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -1,3 +1,15 @@
|
||||
## Stage 1: Build frontend (Vue/Vite)
|
||||
FROM node:22-alpine AS web-builder
|
||||
|
||||
WORKDIR /app/web
|
||||
|
||||
COPY web/package.json web/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY web/ ./
|
||||
RUN npm run build
|
||||
|
||||
## Stage 2: Build backend (TypeScript)
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
@@ -12,7 +24,7 @@ COPY tsconfig.json ./
|
||||
COPY src/ ./src/
|
||||
RUN npm run build
|
||||
|
||||
# --- Production image ---
|
||||
## Stage 3: Production image
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
@@ -25,6 +37,7 @@ RUN npm ci --omit=dev --ignore-scripts=false && \
|
||||
rm -rf /root/.npm /tmp/*
|
||||
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=web-builder /app/web/dist ./public
|
||||
|
||||
ENV PORT=8080
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
Reference in New Issue
Block a user