Move Prisma config to project root as .mjs for Prisma 7
Some checks failed
Build and Push Docker Image / lint-and-typecheck (push) Failing after 1m9s
Build and Push Docker Image / build (push) Has been skipped

- Move prisma.config.ts to prisma.config.mjs at project root
- Use dynamic dotenv import (works in Docker without dotenv)
- Add dotenv to devDependencies for local development
- Install dotenv globally in Docker for migration support

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-17 15:31:23 +01:00
parent 053463b7e1
commit 8157531fba
4 changed files with 28 additions and 15 deletions

View File

@@ -61,13 +61,14 @@ RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Copy Prisma (client and schema for migrations)
# Copy Prisma (client, schema, and config for migrations)
COPY --from=deps /app/node_modules/.prisma ./node_modules/.prisma
COPY --from=deps /app/node_modules/@prisma ./node_modules/@prisma
COPY prisma ./prisma/
COPY prisma.config.mjs ./
# Install Prisma CLI globally for migrations
RUN npm install -g prisma@7
# Install Prisma CLI and dotenv globally for migrations
RUN npm install -g prisma@7 dotenv
USER nextjs