feat: update environment configuration for production and add Docker support
CI/CD / test-and-build (push) Waiting to run
CI/CD / deploy (push) Blocked by required conditions

This commit is contained in:
Najjar\NajjarV02
2026-04-15 10:04:07 +04:00
parent 3fbdc3b187
commit 138e8377a6
6 changed files with 124 additions and 7 deletions
+4 -2
View File
@@ -5,8 +5,10 @@ import path from 'path';
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient };
function createPrismaClient() {
const dbPath = path.resolve(process.cwd(), 'prisma/lootah.db');
const adapter = new PrismaLibSql({ url: `file:${dbPath}` });
// Use DATABASE_URL if set (production/Coolify), otherwise fall back to local path.
const dbUrl = process.env.DATABASE_URL
?? `file:${path.resolve(process.cwd(), 'prisma/lootah.db')}`;
const adapter = new PrismaLibSql({ url: dbUrl });
return new PrismaClient({ adapter } as ConstructorParameters<typeof PrismaClient>[0]);
}