From 3acaafa6e9152f3569e13773697d39ea687ce987 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Tue, 7 Apr 2026 15:13:23 +0200 Subject: [PATCH] fix: use npm instead of pnpm in Docker for native binding compilation pnpm's symlink store prevents better-sqlite3 native bindings from being compiled/found. npm places files directly and compiles native modules reliably. Co-Authored-By: Claude Opus 4.6 (1M context) --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4fda72e..291cc6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,11 @@ FROM node:24-alpine RUN apk add --no-cache python3 make g++ WORKDIR /app -RUN corepack enable pnpm -COPY package.json pnpm-lock.yaml ./ -RUN pnpm install --frozen-lockfile && pnpm rebuild better-sqlite3 +COPY package.json ./ +RUN npm install RUN find node_modules -name "better_sqlite3.node" || (echo "FATAL: binding not found" && exit 1) COPY . . -RUN pnpm run build -# Keep only build tools cleanup that won't remove sqlite-libs +RUN npx nuxt build RUN apk del make g++ && rm -rf /root/.cache /tmp/* RUN mkdir -p /data && chown node:node /data USER node