Skip to content

Conversation

@github-actions
Copy link
Contributor

This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.

* feat(api): add multi-stage Docker build configuration and docker-compose

* chore(api): add comment for local testing in docker-compose file

---------

Co-authored-by: Tofik Hasanov <annexcies@gmail.com>
Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
@vercel
Copy link

vercel bot commented Dec 16, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Review Updated (UTC)
app (staging) Skipped Skipped Dec 16, 2025 9:43pm
portal (staging) Skipped Skipped Dec 16, 2025 9:43pm

@cursor
Copy link

cursor bot commented Dec 16, 2025

PR Summary

Introduces a multi-stage Docker build for the API with CI/CD buildspec and local docker-compose, and adds the esbuild dependency.

  • Infrastructure / Docker:
    • Multi-stage build: Add apps/api/Dockerfile.multistage to install workspace deps with Bun, build packages, generate Prisma client, build NestJS, and run a Node 20-alpine production image with non-root user and /v1/health healthcheck on port 3333.
    • CI/CD: Add apps/api/buildspec.multistage.yml to build/tag Docker image, push to ECR, and force ECS service redeploy.
    • Local Dev: Add apps/api/docker-compose.yml to run the API container locally on port 3333 with healthcheck.
  • Dependencies:
    • Add esbuild@^0.27.1 to apps/api/package.json.

Written by Cursor Bugbot for commit e59dc63. This will update automatically on new commits. Configure here.

@graphite-app graphite-app bot requested a review from Marfuen December 16, 2025 21:14
@CLAassistant
Copy link

CLAassistant commented Dec 16, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Marfuen
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@graphite-app
Copy link

graphite-app bot commented Dec 16, 2025

Graphite Automations

"Auto-assign PRs to Author" took an action on this PR • (12/16/25)

1 reviewer was added to this PR based on Mariano Fuentes's automation.

Co-authored-by: Tofik Hasanov <annexcies@gmail.com>
@vercel vercel bot temporarily deployed to staging – app December 16, 2025 21:30 Inactive
@vercel vercel bot temporarily deployed to staging – portal December 16, 2025 21:30 Inactive
* chore(api): simplify docker build command in buildspec

* chore(api): update Dockerfile to use bunx for NestJS build

---------

Co-authored-by: Tofik Hasanov <annexcies@gmail.com>
Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
@vercel vercel bot temporarily deployed to staging – portal December 16, 2025 21:42 Inactive
@vercel vercel bot temporarily deployed to staging – app December 16, 2025 21:43 Inactive
Comment on lines +80 to +88
COPY --from=builder /app/node_modules ./node_modules

# Set production environment
ENV NODE_ENV=production
ENV PORT=3333

# Install Prisma CLI and regenerate client in production stage
RUN npm install -g prisma@6.13.0 && \
prisma generate --schema=./prisma/schema.prisma
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical: Runtime incompatibility between Bun and Node.js dependencies

The node_modules directory is installed with Bun (stage 1, line 21) but copied to a Node.js runtime (stage 3, line 80). While Prisma is regenerated (lines 87-88), other packages with native bindings may fail at runtime because they were compiled for Bun's runtime, not Node.js.

Impact: Production crashes when loading native modules (e.g., bcrypt, sharp, any C++ addons)

Fix: Either use the same runtime in all stages, or reinstall production dependencies in the Node.js stage:

# Option 1: Use Node.js throughout
FROM node:20-alpine AS deps
RUN npm install

# Option 2: Reinstall in production stage (after line 71)
RUN npm ci --omit=dev
RUN npm install -g prisma@6.13.0 && prisma generate
Suggested change
COPY --from=builder /app/node_modules ./node_modules
# Set production environment
ENV NODE_ENV=production
ENV PORT=3333
# Install Prisma CLI and regenerate client in production stage
RUN npm install -g prisma@6.13.0 && \
prisma generate --schema=./prisma/schema.prisma
COPY package*.json ./
# Set production environment
ENV NODE_ENV=production
ENV PORT=3333
# Install production dependencies and Prisma CLI
RUN npm ci --omit=dev
RUN npm install -g prisma@6.13.0 && \
prisma generate --schema=./prisma/schema.prisma

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@Marfuen Marfuen merged commit d273b2f into release Dec 16, 2025
14 of 15 checks passed
@claudfuen
Copy link
Contributor

🎉 This PR is included in version 1.72.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants