fix: remove pg adapter, use standard PrismaClient - add prisma db push to Dockerfile CMD
This commit is contained in:
+8
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user