Files
brainstorming/Dockerfile
Alejandro Martinez 3acaafa6e9 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>
2026-04-07 15:13:23 +02:00

17 lines
563 B
Docker

FROM node:24-alpine
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json ./
RUN npm install
RUN find node_modules -name "better_sqlite3.node" || (echo "FATAL: binding not found" && exit 1)
COPY . .
RUN npx nuxt build
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"]