fix(api): pnpm deploy + copy prisma generated client
This commit is contained in:
+5
-2
@@ -7,13 +7,16 @@ COPY . .
|
||||
RUN pnpm install --frozen-lockfile 2>/dev/null || pnpm install --no-frozen-lockfile --force
|
||||
RUN pnpm --filter @moraworld/database exec prisma generate && pnpm --filter @moraworld/database build
|
||||
RUN pnpm --filter @moraworld/api build
|
||||
RUN mkdir /app/flat-node && cp -rL node_modules/. /app/flat-node/
|
||||
RUN pnpm deploy --filter @moraworld/api --prod /app/deploy
|
||||
RUN for d in /app/node_modules/.pnpm/@prisma+client*/node_modules/.prisma; do \
|
||||
[ -d "$d" ] && cp -rL "$d" /app/deploy/node_modules/ && break; \
|
||||
done && ls /app/deploy/node_modules/.prisma/client/ 2>/dev/null || echo "prisma client not copied"
|
||||
|
||||
FROM node:22-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
RUN addgroup -S app && adduser -S app app
|
||||
COPY --from=builder /app/flat-node ./node_modules
|
||||
COPY --from=builder /app/deploy/node_modules ./node_modules
|
||||
COPY --from=builder /app/apps/api/dist ./dist
|
||||
COPY --from=builder /app/apps/api/package.json ./
|
||||
COPY --from=builder /app/packages/database ./packages/database
|
||||
|
||||
Reference in New Issue
Block a user