All checks were successful
Build & Deploy Frontend / build-push-deploy (push) Successful in 1m45s
25 lines
613 B
Docker
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;"] |