From ca583ea6c93227dfba332d4b040d6ccd415dccd0 Mon Sep 17 00:00:00 2001 From: Santhosh Janardhanan Date: Mon, 13 Apr 2026 00:36:12 -0400 Subject: [PATCH] fix: Dockerfile uses npm prune instead of npm ci for production deps The run stage no longer runs npm ci --omit=dev (which fails when package-lock.json and the Docker environment's resolved deps are out of sync, e.g. @emnapi/* transitive deps from adapter-node). Instead, the build stage runs npm prune --omit=dev after building, and the run stage copies the already-pruned node_modules. This avoids any lock file sync issues across different environments. --- .env.docker | Bin 173 -> 62 bytes Dockerfile | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.env.docker b/.env.docker index b7c371371d18955dff498f961c8e688f81f7d19e..bdf0ba8d87549c711ed8843cef563baa03851b61 100644 GIT binary patch literal 62 zcmezW&!52u2pt)GfjAyW`ZKsNxB^9N8FGLyks%j|jT!V9j2NuI{1S##hGK>i23`g( F1^}7A3poG) literal 173 zcmX|)K?=e!6h!wu#Xz@FPy94s&WUE8iEoX{xq5wfa~$had0*X`niA diff --git a/Dockerfile b/Dockerfile index 4d0bce0..3dd07b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,16 +9,17 @@ RUN npm ci COPY . . RUN npm run build +# Prune dev dependencies for the production image +RUN npm prune --omit=dev + # ---- Run stage ---- FROM node:22-alpine AS run WORKDIR /app -COPY package.json package-lock.json ./ -RUN npm ci --omit=dev - +COPY --from=build /app/package.json ./ +COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/build ./build -COPY --from=build /app/package.json . ENV PORT=3000 ENV HOST=0.0.0.0