Files
Randall/cicd/docker/Dockerfile.frontend
Robert van Diest 1301a01d6d Initial commit
2026-03-24 20:13:07 +01:00

25 lines
672 B
Docker

# Build stage
FROM node:22-alpine AS build
WORKDIR /app
# Install dependencies — copy lockfiles first to cache the npm layer
COPY src/frontend/package.json src/frontend/package-lock.json ./
RUN npm ci
# Copy source
COPY src/frontend/index.html ./
COPY src/frontend/vite.config.ts ./
COPY src/frontend/tsconfig.json src/frontend/tsconfig.app.json src/frontend/tsconfig.node.json ./
COPY src/frontend/eslint.config.js ./
COPY src/frontend/src/ ./src/
COPY src/frontend/public/ ./public/
RUN npm run build
# Serve stage
FROM nginx:alpine AS runtime
COPY --from=build /app/dist /usr/share/nginx/html
COPY cicd/docker/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80