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.
This commit is contained in:
2026-04-13 00:36:12 -04:00
parent 792fafc661
commit ca583ea6c9
2 changed files with 5 additions and 4 deletions

Binary file not shown.

View File

@@ -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