fix: resolve Docker build failure by optimizing configuration and prisma signal handling

- Added .dockerignore to prevent build poisoning from local artifacts.
- Updated Dockerfile with stable Bun version, memory limits, and missing config files.
- Refined prisma.ts signal handlers to avoid process termination during Next.js build phases.
- Synchronized eslint-config-next with Next.js version.
This commit is contained in:
2026-04-02 11:24:49 +08:00
parent 8777c45a44
commit 970949a68b
4 changed files with 77 additions and 16 deletions

View File

@@ -29,16 +29,18 @@ process.on('unhandledRejection', async (error) => {
});
// Handle graceful shutdown
process.on('SIGINT', async () => {
console.log('Received SIGINT signal. Closing database connections...');
await prisma.$disconnect();
process.exit(0);
});
if (process.env.NODE_ENV === 'production' && !process.env.NEXT_PHASE) {
process.on('SIGINT', async () => {
console.log('Received SIGINT signal. Closing database connections...');
await prisma.$disconnect();
// Allow natural exit
});
process.on('SIGTERM', async () => {
console.log('Received SIGTERM signal. Closing database connections...');
await prisma.$disconnect();
process.exit(0);
});
process.on('SIGTERM', async () => {
console.log('Received SIGTERM signal. Closing database connections...');
await prisma.$disconnect();
// Allow natural exit
});
}
export default prisma;