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>
20 lines
675 B
Docker
20 lines
675 B
Docker
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
|
|
# Verify native binding was built
|
|
RUN find node_modules -name "better_sqlite3.node" -ls
|
|
COPY . .
|
|
RUN pnpm run build
|
|
# 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
|
|
EXPOSE 3000
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=15s \
|
|
CMD wget -q --spider http://localhost:3000/api/health || exit 1
|
|
ENTRYPOINT ["node", ".output/server/index.mjs"]
|