From 778471927bd70bbe6e2c23b3a60a0a9d0ef1735b Mon Sep 17 00:00:00 2001 From: ghaymah_dev Date: Tue, 30 Sep 2025 16:33:50 +0000 Subject: [PATCH] Add Dockerfile --- Dockerfile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Dockerfile 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