Files
style/Dockerfile
Santhosh Janardhanan ca583ea6c9 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.
2026-04-13 00:36:12 -04:00

28 lines
480 B
Docker

# ---- Build stage ----
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
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 --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/build ./build
ENV PORT=3000
ENV HOST=0.0.0.0
EXPOSE 3000
CMD ["node", "build"]