fix: remove pg adapter, use standard PrismaClient - add prisma db push to Dockerfile CMD

This commit is contained in:
AyrisAI
2026-07-23 17:50:07 +03:00
parent 0ef8af2525
commit 2c557215e1
5 changed files with 37 additions and 242 deletions
+8 -1
View File
@@ -21,9 +21,15 @@ FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN apk add --no-cache libc6-compat
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# node_modules for prisma CLI at runtime
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/public ./public
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
RUN mkdir .next && chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
@@ -31,4 +37,5 @@ USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]
# Push schema (idempotent, safe to run on every start) then start server
CMD sh -c "npx prisma db push --skip-generate 2>&1 | tail -5 && node server.js"