Fix deployment issues

- Remove healthcheck from Dockerfile (Coolify handles this)
- Make database connection non-blocking
- Add Coolify-specific docker-compose file
- Improve error handling for database connection
This commit is contained in:
Mikael Westöö
2026-01-23 21:34:33 +01:00
parent c914be9b46
commit 42993ced70
4 changed files with 56 additions and 11 deletions

View File

@@ -21,14 +21,16 @@ const pool = new Pool({
connectionTimeoutMillis: 2000,
});
// Test database connection
pool.query('SELECT NOW()', (err, res) => {
if (err) {
console.error('Database connection error:', err);
} else {
// Test database connection (non-blocking)
pool.query('SELECT NOW()')
.then((res) => {
console.log('Database connected successfully at:', res.rows[0].now);
}
});
})
.catch((err) => {
console.error('Database connection error:', err.message);
console.error('Application will continue but database operations will fail');
console.error('Please ensure PostgreSQL is running and accessible');
});
// Middleware
app.use(express.json({ limit: '10mb' }));