chore: Update Dockerfile and pnpm configuration to enable build scripts for dependencies
Build and Push Reader Image / docker (push) Successful in 1m9s

This commit is contained in:
2026-05-11 15:49:24 +07:00
parent 7ad39b3639
commit 09734cdadd
3 changed files with 12 additions and 18 deletions
+2 -6
View File
@@ -1,12 +1,8 @@
# Stage 1: Dependencies
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
# pnpm v10+ có cơ chế "approve build scripts"; CI/Docker không tương tác được.
# Dòng dưới đảm bảo Prisma/Sharp được phép build khi cài deps.
RUN corepack enable pnpm \
&& pnpm approve-builds --all \
&& pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN corepack enable pnpm && pnpm install --frozen-lockfile
# Stage 2: Builder
FROM node:22-alpine AS builder
+1 -8
View File
@@ -81,12 +81,5 @@
"tw-animate-css": "1.3.3",
"typescript": "5.7.3"
},
"pnpm": {
"onlyBuiltDependencies": [
"@prisma/client",
"@prisma/engines",
"prisma",
"sharp"
]
}
"pnpm": {}
}
+9 -4
View File
@@ -1,5 +1,10 @@
packages:
- "."
# pnpm v10+ có cơ chế chặn build scripts trong môi trường không tương tác.
# Whitelist các package cần build (Prisma/Sharp) để CI/Docker không fail với ERR_PNPM_IGNORED_BUILDS.
allowBuilds:
'@prisma/client': false
'@prisma/engines': false
prisma: false
sharp: false
"@prisma/client": true
"@prisma/engines": true
prisma: true
sharp: true