2026-01-08 15:49:32 +00:00
|
|
|
# Frontend - Multi-stage optimized build
|
2026-01-08 04:00:41 +00:00
|
|
|
FROM node:22-alpine AS build
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# Copy package files for caching
|
|
|
|
|
COPY src/frontend/package*.json ./
|
2026-01-08 16:53:28 +00:00
|
|
|
RUN npm ci
|
2026-01-08 04:00:41 +00:00
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# Copy source and build
|
2026-01-08 04:00:41 +00:00
|
|
|
COPY src/frontend/ .
|
2026-01-08 15:49:32 +00:00
|
|
|
RUN npm run build -- --configuration=production
|
2026-01-08 04:00:41 +00:00
|
|
|
|
2026-01-08 15:49:32 +00:00
|
|
|
# Nginx runtime
|
2026-01-08 04:00:41 +00:00
|
|
|
FROM nginx:alpine AS runtime
|
|
|
|
|
COPY --from=build /app/dist/student-enrollment/browser /usr/share/nginx/html
|
|
|
|
|
COPY deploy/docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
|
|
|
|
|
EXPOSE 80
|
2026-01-08 15:49:32 +00:00
|
|
|
HEALTHCHECK --interval=30s --timeout=3s CMD wget -q --spider http://localhost/ || exit 1
|