From fe42a1ae57bb4dae867e90112720d4e9330a2d14 Mon Sep 17 00:00:00 2001 From: valentinbvro Date: Tue, 21 Jul 2026 12:03:42 +0200 Subject: [PATCH] fix: force devDependencies install in ceo-api Docker build stage npm ci silently skips devDependencies when NODE_ENV=production is set in the environment, which broke the build (nest: not found) once Coolify injected NODE_ENV=production as a build-time var. --include=dev makes the build stage robust regardless of that env var; the runtime stage now does its own --omit=dev install instead of copying the build stage's node_modules wholesale, keeping the final image prod-only. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4af46ec..77e2284 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ FROM node:22-alpine AS build WORKDIR /app COPY package.json package-lock.json ./ -RUN npm ci --legacy-peer-deps +RUN npm ci --legacy-peer-deps --include=dev COPY . . RUN npm run build FROM node:22-alpine WORKDIR /app ENV NODE_ENV=production -COPY --from=build /app/node_modules ./node_modules +COPY package.json package-lock.json ./ +RUN npm ci --legacy-peer-deps --omit=dev COPY --from=build /app/dist ./dist -COPY package.json ./ EXPOSE 3001 CMD ["node", "dist/main"]