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.
This commit is contained in:
parent
4372684f1b
commit
fe42a1ae57
1 changed files with 3 additions and 3 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
Loading…
Reference in a new issue