From 7e654ab87432d050cf32a7777d32b0c627782d02 Mon Sep 17 00:00:00 2001 From: Vishesh 'ironeagle' Bangotra Date: Mon, 22 Sep 2025 20:52:59 +0530 Subject: [PATCH] added dockerfile for homepage --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..70138f6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Stage 1: Build +FROM node:20-alpine AS builder + +# Set working directory +WORKDIR /app + +# Copy package.json and package-lock.json (or yarn.lock) +COPY package*.json ./ + +# Install dependencies +RUN npm ci + +# Copy the rest of the app +COPY . . + +# Build the app (React/Next/etc.) +RUN npm run build + +# Stage 2: Production image +FROM node:20-alpine + +WORKDIR /app + +# Copy only build output and dependencies +COPY --from=builder /app/package*.json ./ +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/build ./build + +# Expose port +EXPOSE 3000 + +# Default command +CMD ["npm", "start"]