Update entrypoint script in Dockerfile and remove DATABASE_URL reference from schema.prisma: Modify entrypoint to check for prisma.config.ts instead of schema.prisma, and streamline migration command. Remove DATABASE_URL environment variable usage from schema.prisma for improved clarity.
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m9s

This commit is contained in:
Julien Froidefond
2025-12-19 08:58:48 +01:00
parent 881b8149e5
commit 5dc178543e
2 changed files with 3 additions and 4 deletions

View File

@@ -69,10 +69,10 @@ RUN echo '#!/bin/sh' > /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 schema.prisma)..."' >> /app/entrypoint.sh && \
echo 'ls -la /app/prisma/schema.prisma || echo "ERROR: schema.prisma not found"' >> /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 --schema=./prisma/schema.prisma' >> /app/entrypoint.sh && \
echo 'cd /app && pnpm dlx prisma migrate deploy' >> /app/entrypoint.sh && \
echo 'exec pnpm start' >> /app/entrypoint.sh && \
chmod +x /app/entrypoint.sh && \
chown nextjs:nodejs /app/entrypoint.sh

View File

@@ -5,7 +5,6 @@ generator client {
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {