File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,20 +27,26 @@ RUN npm run build
2727# =============================================
2828FROM node:24-alpine AS production
2929
30- # Security: no root, no shell attack surface
31- RUN addgroup -S app && adduser -S app -G app \
32- && apk --no-cache add tini \
30+ # Install build tools for native modules (better-sqlite3) and tini
31+ RUN apk --no-cache add \
32+ python3 \
33+ make \
34+ g++ \
35+ tini \
3336 && rm -rf /var/cache/apk/*
3437
38+ # Security: no root, no shell attack surface
39+ RUN addgroup -S app && adduser -S app -G app
40+
3541WORKDIR /app
3642
3743# Copy only production artifacts
3844COPY --from=build /app/dist ./dist
3945COPY --from=build /app/package.json ./package.json
4046COPY --from=build /app/package-lock.json ./package-lock.json
4147
42- # Install ONLY production deps
43- RUN npm ci --omit=dev --ignore-scripts \
48+ # Install ONLY production deps (build better-sqlite3 native module)
49+ RUN npm ci --omit=dev \
4450 && npm cache clean --force \
4551 && rm -rf /tmp/*
4652
You can’t perform that action at this time.
0 commit comments