fix: keep python3 runtime, verify native binding path, selective cleanup

apk del python3 cascades to remove sqlite-libs. Only remove make/g++.
Add debug step to verify better_sqlite3.node was built.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alejandro Martinez
2026-04-07 14:50:09 +02:00
parent 11d28a1b0d
commit 00aa075d47

View File

@@ -4,9 +4,12 @@ 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" -ls
COPY . .
RUN pnpm run build
RUN apk del python3 make g++ && rm -rf /root/.cache /tmp/*
# Keep only build tools cleanup that won't remove sqlite-libs
RUN apk del make g++ && rm -rf /root/.cache /tmp/*
RUN mkdir -p /data && chown node:node /data
USER node
ENV NODE_ENV=production