feat: use nextjs.js standalone output for improvised docker image (#338)

This commit is contained in:
Nafees Nazik
2023-11-10 12:11:49 +05:30
committed by Mythie
parent aec0d2ae97
commit d6ae0b44e6
5 changed files with 102 additions and 30 deletions

View File

@ -23,6 +23,11 @@ export const getDatabaseUrl = () => {
process.env.NEXT_PRIVATE_DIRECT_DATABASE_URL = process.env.POSTGRES_URL_NON_POOLING;
}
// If we don't have a database URL, we can't normalize it.
if (!process.env.NEXT_PRIVATE_DATABASE_URL) {
return undefined;
}
// We change the protocol from `postgres:` to `https:` so we can construct a easily
// mofifiable URL.
const url = new URL(process.env.NEXT_PRIVATE_DATABASE_URL.replace('postgres://', 'https://'));

View File

@ -8,6 +8,7 @@
"build": "prisma generate",
"format": "prisma format",
"clean": "rimraf node_modules",
"post-install": "prisma generate",
"prisma:generate": "prisma generate",
"prisma:migrate-dev": "prisma migrate dev",
"prisma:migrate-deploy": "prisma migrate deploy",