42ff3e8f33
Build & Deploy / Test & Lint (push) Has been cancelled
Build & Deploy / Security Scan (push) Has been cancelled
Code Quality / Code Quality Checks (push) Has been cancelled
Code Quality / Dependency Vulnerabilities (push) Has been cancelled
Code Quality / Performance Testing (push) Has been cancelled
Build & Deploy / Build Docker Images (push) Has been cancelled
Build & Deploy / Deploy to Kubernetes (push) Has been cancelled
38 lines
779 B
Docker
38 lines
779 B
Docker
# Frontend Dockerfile - Node with Static Serving
|
|
# Optimized for production with minimal size
|
|
|
|
FROM node:18-alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy frontend
|
|
COPY frontend/package.json frontend/package-lock.json ./
|
|
COPY frontend/. ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci
|
|
|
|
# Build production bundle
|
|
RUN npm run build
|
|
|
|
# Runtime stage - nginx lightweight server
|
|
FROM node:18-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built files
|
|
COPY --from=builder /app/dist ./dist
|
|
|
|
# Install global serve package for static file serving
|
|
RUN npm install -g serve
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --quiet --tries=1 --spider http://localhost:5173 || exit 1
|
|
|
|
# Expose port
|
|
EXPOSE 5173
|
|
|
|
# Start static server
|
|
CMD ["serve", "-s", "dist", "-l", "5173"]
|