Skip to content

chore(api): update Dockerfile for production runtime optimizations#2194

Merged
Marfuen merged 1 commit intomainfrom
mariano/fix-again-api
Feb 27, 2026
Merged

chore(api): update Dockerfile for production runtime optimizations#2194
Marfuen merged 1 commit intomainfrom
mariano/fix-again-api

Conversation

@Marfuen
Copy link
Contributor

@Marfuen Marfuen commented Feb 27, 2026

What does this PR do?

  • Fixes #XXXX (GitHub issue number)
  • Fixes COMP-XXXX (Linear issue number - should be visible at the bottom of the GitHub issue description)

Visual Demo (For contributors especially)

A visual demonstration is strongly recommended, for both the original and new change (video / image - any one).

Video Demo (if applicable):

  • Show screen recordings of the issue or feature.
  • Demonstrate how to reproduce the issue, the behavior before and after the change.

Image Demo (if applicable):

  • Add side-by-side screenshots of the original and updated change.
  • Highlight any significant change(s).

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  • Are there environment variables that should be set?
  • What are the minimal test data to have?
  • What is expected (happy path) to have (input and output)?
  • Any other important info that could help to test that PR

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings

@vercel
Copy link

vercel bot commented Feb 27, 2026

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

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped Feb 27, 2026 1:59am
portal Skipped Skipped Feb 27, 2026 1:59am

Request Review

@cursor
Copy link

cursor bot commented Feb 27, 2026

PR Summary

Medium Risk
Changes the production container base image and rebuilds native dependencies/Prisma client at runtime, which can affect build reliability and production startup behavior. Runtime package and user-creation changes may introduce platform-specific issues if assumptions differ from the previous Alpine-based image.

Overview
Updates the API multi-stage Docker build to use node:20-slim for the production stage and switches runtime package installation from apk to apt-get.

Removes the global Prisma CLI install and instead runs npm rebuild plus npx prisma generate in the production image to better match the final Node environment, and starts Node with fatal-error crash reports enabled. Also updates non-root user creation commands to Debian/Ubuntu tooling (groupadd/useradd).

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

@Marfuen Marfuen merged commit e9964ee into main Feb 27, 2026
9 checks passed
@Marfuen Marfuen deleted the mariano/fix-again-api branch February 27, 2026 02:00
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

prisma generate --schema=./prisma/schema.prisma
# Rebuild native modules for this exact Node.js version and regenerate Prisma client
RUN npm rebuild && \
npx 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.

npm rebuild may fail without build tools

Medium Severity

npm rebuild can trigger native addon compilation via node-gyp, which needs Python, make, and g++/gcc. node:20-slim does not include build-essential or Python, so the Docker build may fail if any dependency (e.g. esbuild, playwright-core, or their transitive deps) requires compilation instead of prebuilt binaries.

Additional Locations (1)

Fix in Cursor Fix in Web

@claudfuen
Copy link
Contributor

🎉 This PR is included in version 1.86.1 🎉

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants