From 9fc75fc3bb95ff671b5beabda6fdbae9e3bd6f69 Mon Sep 17 00:00:00 2001 From: umeshdevop11 Date: Wed, 10 Dec 2025 12:17:23 +0530 Subject: [PATCH 1/2] Update Dockerfile to use Node 24 and optimize installs --- Dockerfile | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d93f34b..f773f13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,23 @@ -FROM node:16-slim AS builder +# Stage 1: Build +FROM node:24-slim AS builder # use current LTS instead of node:16-slim WORKDIR /app + COPY package*.json ./ -RUN npm install +RUN npm install # or: npm ci + COPY . . RUN npm run build -# Stage 2: Production -FROM builder AS final +# Stage 2: Runtime +FROM node:24-slim AS final WORKDIR /app -COPY --from=builder /app/build ./build + COPY package*.json ./ -RUN npm install --production +RUN npm install --omit=dev # only production deps (npm v7+) + +# Copy only the build output from the builder stage +COPY --from=builder /app/build ./build + EXPOSE 3000 CMD ["npm", "start"] + From cdc7767216e7f4ddde74a2b8cd6ad5be0e7357bf Mon Sep 17 00:00:00 2001 From: umeshdevop11 Date: Wed, 10 Dec 2025 17:01:50 +0530 Subject: [PATCH 2/2] Update Dockerfile --- Dockerfile | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index f773f13..d93f34b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,15 @@ -# Stage 1: Build -FROM node:24-slim AS builder # use current LTS instead of node:16-slim +FROM node:16-slim AS builder WORKDIR /app - COPY package*.json ./ -RUN npm install # or: npm ci - +RUN npm install COPY . . RUN npm run build -# Stage 2: Runtime -FROM node:24-slim AS final +# Stage 2: Production +FROM builder AS final WORKDIR /app - -COPY package*.json ./ -RUN npm install --omit=dev # only production deps (npm v7+) - -# Copy only the build output from the builder stage COPY --from=builder /app/build ./build - +COPY package*.json ./ +RUN npm install --production EXPOSE 3000 CMD ["npm", "start"] -