diff --git a/Dockerfile b/Dockerfile index e472a2e..ba645c1 100755 --- a/Dockerfile +++ b/Dockerfile @@ -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"]