Skip to content

Commit f6eed1a

Browse files
committed
fix(docker): use --ignore-scripts + pnpm rebuild sharp
pnpm 11 no longer reads the 'pnpm' field in package.json and onlyBuiltDependencies in pnpm-workspace.yaml doesn't work with --frozen-lockfile. The reliable approach is to install with --ignore-scripts and then explicitly rebuild sharp.
1 parent bfc4094 commit f6eed1a

3 files changed

Lines changed: 4 additions & 11 deletions

File tree

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ WORKDIR /app
1313
RUN apk add --no-cache git
1414

1515
# Copiar los archivos de dependencias primero permite cachear la instalación
16-
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
17-
RUN pnpm install --frozen-lockfile --prod=false
16+
# --ignore-scripts evita el error ERR_PNPM_IGNORED_BUILDS de pnpm 11 con sharp
17+
COPY package.json pnpm-lock.yaml ./
18+
RUN pnpm install --frozen-lockfile --prod=false --ignore-scripts && \
19+
pnpm rebuild sharp
1820

1921
FROM base AS builder
2022
WORKDIR /app

package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,5 @@
3333
"postcss": "^8.5.22",
3434
"tailwindcss": "^4.3.3",
3535
"typescript": "^5.9.3"
36-
},
37-
"pnpm": {
38-
"onlyBuiltDependencies": [
39-
"sharp"
40-
]
4136
}
4237
}

pnpm-workspace.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)