fix: force pnpm rebuild better-sqlite3 for native binding

pnpm install doesn't compile native bindings in Alpine. Explicit
rebuild ensures the .node file is generated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Martinez
2026-04-07 15:07:50 +02:00
parent 487f60e275
commit 500653301e

View File

@@ -3,9 +3,8 @@ 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
# Verify native binding was built
RUN find node_modules -name "better_sqlite3.node" && echo "--- binding found ---"
RUN pnpm install --frozen-lockfile && pnpm rebuild better-sqlite3
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