fix: API copy Prisma from pnpm store, AI drop Rust/maturin approach
Some checks failed
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 10s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 11s
E2E Tests / Playwright E2E (push) Failing after 10s
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 6s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped

- API: copy @prisma/client + .prisma from build stage pnpm store glob
  (pnpm deploy --prod doesn't include generated Prisma client)
- AI: remove Rust toolchain, install underthesea 6.8.0 with fallback to 6.3.4
  (underthesea-core maturin build too complex for Kaniko)

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-14 00:32:35 +07:00
parent 4418d60c2b
commit 3de953223a
2 changed files with 14 additions and 20 deletions

View File

@@ -35,13 +35,8 @@ RUN npx prisma generate \
&& cd apps/api && npx nest build
# Use pnpm deploy to produce a flat, production-only node_modules
# Then install prisma + generate client in pruned dir (pnpm deploy strips dev deps)
RUN pnpm deploy --legacy --filter @goodgo/api --prod /app/pruned \
&& cd /app/pruned \
&& cp -r /app/prisma ./prisma \
&& npm install --no-save prisma @prisma/client \
&& npx prisma generate \
&& npm remove --no-save prisma
# Copy generated Prisma client from build stage (pnpm deploy doesn't carry it)
RUN pnpm deploy --legacy --filter @goodgo/api --prod /app/pruned
# ---- Production ----
FROM node:22-slim AS production
@@ -60,12 +55,15 @@ WORKDIR /app
ENV NODE_ENV=production
# Copy pruned production node_modules from pnpm deploy (includes Prisma)
# Copy pruned production node_modules
COPY --from=build --chown=node:node /app/pruned/node_modules ./node_modules
# Copy compiled application
COPY --from=build --chown=node:node /app/apps/api/dist ./dist
# Prisma schema + migrations (needed for runtime client & migrate deploy)
COPY --from=build --chown=node:node /app/prisma ./prisma
# Copy generated Prisma client from build stage (not from pruned)
COPY --from=build --chown=node:node /app/node_modules/.pnpm/@prisma+client@*/node_modules/@prisma/client ./node_modules/@prisma/client
COPY --from=build --chown=node:node /app/node_modules/.pnpm/@prisma+client@*/node_modules/.prisma ./node_modules/.prisma
# Package metadata
COPY --from=build --chown=node:node /app/apps/api/package.json ./package.json
# Entrypoint script