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) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,11 @@
|
|||||||
FROM node:24-alpine
|
FROM node:24-alpine
|
||||||
RUN apk add --no-cache python3 make g++
|
RUN apk add --no-cache python3 make g++
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN corepack enable pnpm
|
COPY package.json ./
|
||||||
COPY package.json pnpm-lock.yaml ./
|
RUN npm install
|
||||||
RUN pnpm install --frozen-lockfile && pnpm rebuild better-sqlite3
|
|
||||||
RUN find node_modules -name "better_sqlite3.node" || (echo "FATAL: binding not found" && exit 1)
|
RUN find node_modules -name "better_sqlite3.node" || (echo "FATAL: binding not found" && exit 1)
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm run build
|
RUN npx nuxt build
|
||||||
# Keep only build tools cleanup that won't remove sqlite-libs
|
|
||||||
RUN apk del make g++ && rm -rf /root/.cache /tmp/*
|
RUN apk del make g++ && rm -rf /root/.cache /tmp/*
|
||||||
RUN mkdir -p /data && chown node:node /data
|
RUN mkdir -p /data && chown node:node /data
|
||||||
USER node
|
USER node
|
||||||
|
|||||||
Reference in New Issue
Block a user