From 6e7c5d3eaf403a4033be81893bbcd1951286de4f Mon Sep 17 00:00:00 2001 From: Julien Froidefond Date: Fri, 19 Dec 2025 09:00:37 +0100 Subject: [PATCH] Update Dockerfile to include prisma.config.ts and streamline entrypoint script: Add copying of prisma.config.ts for Prisma 7 compatibility and remove unnecessary migration checks from the entrypoint script for improved clarity. --- Dockerfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 488d252..19fd03d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,8 +45,10 @@ COPY --from=builder --chown=nextjs:nodejs /app/public ./public COPY --from=builder /app/package.json ./package.json COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml COPY --from=builder /app/next.config.js ./next.config.js -# Copier le répertoire prisma complet (schema + migrations + config) +# Copier le répertoire prisma complet (schema + migrations) COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma +# Copier prisma.config.ts (nécessaire pour Prisma 7) +COPY --from=builder --chown=nextjs:nodejs /app/prisma.config.ts ./prisma.config.ts ENV DATABASE_URL="postgresql://user:pass@localhost:5432/db" @@ -63,14 +65,10 @@ RUN echo '#!/bin/sh' > /app/entrypoint.sh && \ echo 'set -e' >> /app/entrypoint.sh && \ echo 'mkdir -p /app/public/uploads' >> /app/entrypoint.sh && \ echo 'mkdir -p /app/public/uploads/backgrounds' >> /app/entrypoint.sh && \ - echo 'echo "Checking migrations..."' >> /app/entrypoint.sh && \ - echo 'ls -la /app/prisma/migrations || echo "Migrations directory not found"' >> /app/entrypoint.sh && \ echo 'if [ -z "$DATABASE_URL" ]; then' >> /app/entrypoint.sh && \ echo ' echo "ERROR: DATABASE_URL is not set"' >> /app/entrypoint.sh && \ echo ' exit 1' >> /app/entrypoint.sh && \ echo 'fi' >> /app/entrypoint.sh && \ - echo 'echo "DATABASE_URL is set (checking prisma.config.ts)..."' >> /app/entrypoint.sh && \ - echo 'ls -la /app/prisma.config.ts || echo "ERROR: prisma.config.ts not found"' >> /app/entrypoint.sh && \ echo 'export DATABASE_URL' >> /app/entrypoint.sh && \ echo 'cd /app && pnpm dlx prisma migrate deploy' >> /app/entrypoint.sh && \ echo 'exec pnpm start' >> /app/entrypoint.sh && \