Compare commits

..

2 Commits

2 changed files with 4 additions and 9 deletions

View File

@@ -45,7 +45,9 @@ 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
COPY --from=builder /app/prisma ./prisma
RUN mkdir -p /app/prisma/migrations
COPY --from=builder --chown=nextjs:nodejs /app/prisma/schema.prisma ./prisma/schema.prisma
COPY --from=builder --chown=nextjs:nodejs /app/prisma/migrations ./prisma/migrations
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
ENV DATABASE_URL="postgresql://user:pass@localhost:5432/db"

View File

@@ -21,10 +21,6 @@ if (typeof databaseUrl !== "string") {
throw new Error("DATABASE_URL must be a string");
}
// Logger l'URL de connexion (masquer le mot de passe pour la sécurité)
const logUrl = databaseUrl.replace(/:\/\/[^:]+:[^@]+@/, "://***:***@");
console.log(`[Prisma] Connecting to PostgreSQL: ${logUrl}`);
const pool = new Pool({
connectionString: databaseUrl,
});
@@ -39,10 +35,7 @@ export const prisma =
globalForPrisma.prisma ??
new PrismaClient({
adapter,
log:
process.env.NODE_ENV === "development"
? ["query", "error", "warn"]
: ["error"],
log: ["error"],
});
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma;