fix(docker): force devDependencies in deps stage (--include=dev)
Coolify injects NODE_ENV=production / npm omit=dev at build time, which made 'npm ci' skip devDependencies. babel-plugin-react-compiler is a devDependency and Next 16's reactCompiler:true requires resolving it, so the build failed with: Failed to resolve package babel-plugin-react-compiler ... React compiler is enabled in next.config.js. Reproduced locally with npm_config_omit=dev (react-compiler MISSING with plain npm ci, PRESENT with --include=dev). --include=dev overrides the platform's omit config so all build-time devDeps are installed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -22,7 +22,10 @@ FROM base AS deps
|
|||||||
COPY package.json package-lock.json .npmrc ./
|
COPY package.json package-lock.json .npmrc ./
|
||||||
# Reproducible install honouring the lockfile (.npmrc provides legacy-peer-deps,
|
# Reproducible install honouring the lockfile (.npmrc provides legacy-peer-deps,
|
||||||
# required because react-google-map-picker declares a React 17 peer).
|
# required because react-google-map-picker declares a React 17 peer).
|
||||||
RUN npm ci --no-audit --no-fund
|
# --include=dev forces devDependencies even when the platform injects
|
||||||
|
# NODE_ENV=production (Coolify does this on all stages); the build needs
|
||||||
|
# devDeps such as babel-plugin-react-compiler (React Compiler) and typescript.
|
||||||
|
RUN npm ci --include=dev --no-audit --no-fund
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------
|
||||||
# 2. Builder — produces the standalone output.
|
# 2. Builder — produces the standalone output.
|
||||||
|
|||||||
Reference in New Issue
Block a user