Fix node-gyp build error

This commit is contained in:
kimpure 2026-02-10 11:16:41 +00:00
parent 6f5e36c23f
commit 781ecee578
3 changed files with 9 additions and 4 deletions

View file

@ -1,4 +1,8 @@
FROM node:24-slim AS builder
FROM alpine AS base
RUN --mount=type=cache,target=/var/cache/apk apk add nodejs python3 npm build-base
FROM base AS builder
WORKDIR /app
@ -8,12 +12,13 @@ RUN --mount=type=cache,target=/root/.npm,sharing=locked npm ci --include=dev
COPY . .
RUN npm run build
FROM node:24-slim AS app
FROM base AS app
WORKDIR /app
COPY package*.json ./
COPY --from=builder /app/dist ./
RUN --mount=type=cache,target=/root/.npm,sharing=locked npm ci --include=prod
RUN apk del --purge build-base python3
CMD [ "npm", "start" ]

View file

@ -6,7 +6,7 @@
"format": "npm run format:prisma",
"build:prisma": "prisma generate",
"build:tsc": "tsc",
"build": "npm run build:tsc && npm run build:prisma",
"build": "npm run build:prisma && npm run build:tsc",
"start": "node .",
"dev": "npm run build && npm run start"
},