production: docker fixes, nginx SSL config, generateStaticParams fallback
Deploy to VPS / deploy (push) Has been cancelled

This commit is contained in:
2026-04-01 16:57:22 +00:00
parent fc24313f15
commit 0118774e31
6 changed files with 64 additions and 128 deletions
+15 -3
View File
@@ -30,8 +30,20 @@ function getApplicationImages(slug: string) {
// GENERACIÓN DE RUTAS ESTÁTICAS DESDE LA BD
export async function generateStaticParams() {
const apps = await prisma.application.findMany({ select: { slug: true } });
return apps.map((app: { slug: string }) => ({ slug: app.slug }));
// In production Docker build, DB is not available.
// Pages are generated on-demand via SSR instead.
if (process.env.NODE_ENV === 'production' && !process.env.VERCEL) {
return [];
}
try {
const apps = await prisma.application.findMany({
select: { slug: true },
});
return apps.map((app: any) => ({ slug: app.slug }));
} catch {
return [];
}
}
export const revalidate = 60;
@@ -76,4 +88,4 @@ export default async function ApplicationPage({ params }: { params: Promise<{ sl
// Pasamos TODO al componente cliente interactivo (que ya viene traducido)
return <ApplicationClient data={data} realCases={realCases} images={images} />;
}
}