This commit is contained in:
2026-02-07 15:20:46 -03:00
parent af3ed05278
commit 7f79d997d2
3 changed files with 19 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
# Use Debian-based image so better-sqlite3 prebuilds (glibc) work; Alpine/musl has no prebuilds.
# Build stage: compile app and native deps (better-sqlite3) for target platform.
FROM node:20-bookworm-slim AS builder
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
@@ -6,13 +6,14 @@ COPY package.json pnpm-lock.yaml* ./
RUN pnpm install
COPY . .
RUN pnpm run build
RUN pnpm prune --prod
# Runtime: copy built artifacts and node_modules (with compiled better_sqlite3.node).
FROM node:20-bookworm-slim
RUN corepack enable && corepack prepare pnpm@latest --activate
WORKDIR /app
ENV NODE_ENV=production
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --prod
COPY package.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
EXPOSE 8080
CMD ["node", "dist/index.js"]