diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ad2a9eb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +# Stage 1: Build the React app +FROM node:18-alpine AS builder + +# Set working directory +WORKDIR /app + +# Copy package files +COPY package*.json ./ + +# Install dependencies +RUN npm ci --silent + +# Copy source code +COPY . . + +# Build the app +RUN npm run build + +# Stage 2: Serve the app with Nginx +FROM nginx:alpine + +# Copy built app from builder stage +COPY --from=builder /app/build /usr/share/nginx/html + +# Copy custom nginx config (optional) +COPY nginx.conf /etc/nginx/conf.d/default.conf + +# Expose port 80 +EXPOSE 80 + +# Start Nginx +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file