diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index 448e89e..86cf387 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -34,10 +34,6 @@ RUN npx prisma generate \ && (pnpm --filter @goodgo/mcp-servers build 2>/dev/null || true) \ && cd apps/api && npx nest build -# Use pnpm deploy to produce a flat, production-only node_modules -# 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 @@ -48,22 +44,19 @@ LABEL org.opencontainers.image.title="goodgo-api" \ # dumb-init for proper PID 1 signal handling RUN apt-get update \ - && apt-get install -y --no-install-recommends dumb-init \ + && apt-get install -y --no-install-recommends dumb-init openssl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app ENV NODE_ENV=production -# Copy pruned production node_modules -COPY --from=build --chown=node:node /app/pruned/node_modules ./node_modules +# Copy full node_modules from build stage (pnpm deploy --prod is unreliable in monorepo) +COPY --from=build --chown=node:node /app/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