From 7ff308751e2455bca03b7f337e39a46793bef79a Mon Sep 17 00:00:00 2001 From: Vivek Date: Mon, 8 Jun 2026 09:29:28 +0000 Subject: [PATCH] Update Dockerfile to copy built assets to nginx and use custom config --- Dockerfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index d19e5af..9ecf1c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,15 @@ # --------------------------------------------------------- FROM node:18-alpine AS builder -# Install git (needed by some npm postinstall scripts) +# Install dependencies RUN apk add --no-cache git WORKDIR /app -# Install dependencies (uses package-lock if present, otherwise npm install) -COPY package.json package-lock.json* ./ +# Copy package files +COPY package.json ./ + +# Install dependencies RUN npm install # Copy source files @@ -20,15 +22,12 @@ ENV NODE_ENV=production RUN npm run build # --------------------------------------------------------- -# Production stage – tiny static server +# Production stage – tiny static server # --------------------------------------------------------- FROM nginx:alpine -# Remove default nginx config -RUN rm /etc/nginx/conf.d/default.conf - -# Copy custom config -COPY nginx.conf /etc/nginx/conf.d +# Copy only our custom config +COPY nginx.conf /etc/nginx/conf.d/default.conf # Copy built assets COPY --from=builder /app/dist /usr/share/nginx/html