feat: add Docker support with PostgreSQL and health check endpoint

This commit is contained in:
2026-03-29 20:38:56 -07:00
parent 5bd1f2359c
commit bcb967017f
7 changed files with 617 additions and 1 deletions
+27
View File
@@ -0,0 +1,27 @@
import { NextResponse } from "next/server";
import { prisma } from "@/lib/prisma";
export async function GET() {
try {
// Check database connection
await prisma.$queryRaw`SELECT 1`;
return NextResponse.json({
status: "healthy",
database: "connected",
timestamp: new Date().toISOString(),
});
} catch (error) {
console.error("Health check failed:", error);
return NextResponse.json(
{
status: "unhealthy",
database: "disconnected",
error: "Database connection failed",
timestamp: new Date().toISOString(),
},
{ status: 503 }
);
}
}