diff --git a/front/Dockerfile b/front/Dockerfile index c683533..52cb908 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -11,18 +11,19 @@ COPY package.json package-lock.json ./ COPY front/package.json ./front/package.json COPY packages/db-model/package.json ./packages/db-model/package.json -# 2) Remove packageManager field to prevent Corepack (Node 22) from -# hijacking yarn calls that Next.js SWC patching makes internally. -RUN node -e "const p='package.json',j=JSON.parse(require('fs').readFileSync(p));delete j.packageManager;require('fs').writeFileSync(p,JSON.stringify(j,null,2))" - -# 3) Install all dependencies for the monorepo (npm workspaces) +# 2) Install all dependencies for the monorepo (npm workspaces) # We need dev deps here because Next build typically requires them. # --ignore-scripts: skip postinstall (env vars come from the cloud provider) RUN npm ci --ignore-scripts -# 4) Now copy the full source code +# 3) Now copy the full source code COPY . . +# 4) Remove packageManager field to prevent Corepack (Node 22) from +# hijacking yarn calls that Next.js SWC patching makes internally. +# Must run AFTER "COPY . ." which overwrites the earlier package.json. +RUN node -e "const p='package.json',j=JSON.parse(require('fs').readFileSync(p));delete j.packageManager;require('fs').writeFileSync(p,JSON.stringify(j,null,2))" + # 5) Build the internal dependency used by the front (db-model) # If your workspace name differs, adjust "-w db-model" RUN npm run -w db-model build --if-present