#21: keep devDependencies in the build stage regardless of NODE_ENV
The deployment sets NODE_ENV=production, and npm omits devDependencies when it is set - so "npm ci" in the build stage installed no typescript and "npm run build" failed with exit 127, command not found. The first Coolify deployment died there. The build stage now asks for them explicitly rather than depending on the environment it happens to run in. Reproduced by building all three images with NODE_ENV=production before and after. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7a4ca10a39
commit
64c9efe078
3 files changed
+11
-5
No files matched your search
@@ -2,8 +2,10 @@ FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json* ./
|
||||
# npm ci, not npm install: the image must be the lockfile's content, not
|
||||
# whatever resolves the day it is built.
|
||||
RUN npm ci
|
||||
# whatever resolves the day it is built. --include=dev because this stage
|
||||
# needs typescript, and npm omits devDependencies when NODE_ENV=production -
|
||||
# which the deployment sets.
|
||||
RUN npm ci --include=dev
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
|
||||
Reference in new issue
Block a user