Enhance deployment script with separate health checks for frontend and backend services

This commit is contained in:
2026-01-29 06:37:29 +00:00
parent ffe8f6c83d
commit 9f8c7ed741

View File

@@ -493,20 +493,29 @@ async function deploy() {
console.log('\n✅ Container started');
// Health check
console.log('\n🏥 Performing health check...');
const isHealthy = await healthCheck(sshConfig.host, config.port);
if (!isHealthy) {
throw new Error('Health check failed - container is not responding');
// Health checks
console.log('\n🏥 Performing health checks...');
console.log(' Checking frontend...');
const frontendHealthy = await healthCheck(sshConfig.host, config.port);
if (!frontendHealthy) {
throw new Error('Frontend health check failed - container is not responding');
}
console.log(' ✅ Frontend healthy');
console.log('✅ Health check passed');
console.log(' Checking backend...');
const backendHealthy = await healthCheck(sshConfig.host, config.backendPort);
if (!backendHealthy) {
throw new Error('Backend health check failed - container is not responding');
}
console.log(' ✅ Backend healthy');
console.log('\n✅ All health checks passed');
console.log(`\n🎉 Deployment successful!`);
console.log(`🌐 HTTP: http://${sshConfig.host}:${config.port}`);
console.log(`🌐 Frontend: http://${sshConfig.host}:${config.port}`);
if (config.sslPort) {
console.log(`🔒 HTTPS: https://${sshConfig.host}:${config.sslPort}`);
console.log(`🔒 HTTPS: https://${sshConfig.host}:${config.sslPort}`);
}
console.log(`🔌 Backend: http://${sshConfig.host}:${config.backendPort}`);
ssh.dispose();
} catch (error) {