Files
dwinzo-sdet/app/dockerfile
2025-06-23 13:25:24 +00:00

26 lines
567 B
Plaintext

# Stage 1: Build
FROM node:18 AS builder
WORKDIR /app
COPY . .
# Install dependencies with legacy peer deps to avoid version conflicts
RUN npm install --legacy-peer-deps && npm install -g vite && 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 files from builder
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy custom Nginx config if needed
# COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]