fix: pin prisma CLI in image, force NODE_ENV=production at runtime

Deploy platform injects NODE_ENV=development; CMD now overrides it.
Global prisma@6.19.2 removes the npx download on every container start.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
fatmacetinandClaude Code committed 2026-10-28 21:15:41 +01:00
1 parent 5871606ae6
commit f0bdf185d5
1 file changed
+6 -2
+6 -2
View File
@@ -32,6 +32,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
sqlite3 curl && \
rm -rf /var/lib/apt/lists/*
# Pin prisma CLI into the image so CMD's db push doesn't npx-download prisma on every start
RUN npm i -g prisma@6.19.2
# Copy built app
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
@@ -49,5 +52,6 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
EXPOSE 3000
# Run migrations + start server
CMD ["sh", "-c", "npx prisma db push --accept-data-loss && node server.js"]
# Run migrations + start server. NODE_ENV is forced here because the deploy
# platform injects NODE_ENV=development, which breaks the production server.
CMD ["sh", "-c", "npx prisma db push --accept-data-loss && NODE_ENV=production node server.js"]