erp-cicd/frontend/Dockerfile
Ali af6fd7bcad
All checks were successful
Build & Deploy Frontend / build-push-deploy (push) Successful in 1m45s
added some
2025-08-30 11:57:49 +05:30

25 lines
613 B
Docker

# Stage 1: Build the Vite React App
FROM node:18-alpine AS builder
WORKDIR /app
# Copy package manager files & install dependencies
COPY package*.json bun.lockb ./
RUN npm install --legacy-peer-deps
# Copy the rest of the project & build
COPY . .
RUN npm run build
# Stage 2: Serve with Nginx
FROM nginx:alpine
# Remove default nginx static files
RUN rm -rf /usr/share/nginx/html/*
# Copy built frontend from builder
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy custom nginx.conf (you already have it)
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]