fix(deploy): improve deployment robustness and reliability
- Add docker volume prune to deploy.sh to prevent stale code issues - Add automatic migrations and cache warmup to staging entrypoint - Fix nginx race condition by waiting for PHP-FPM before starting - Improve PHP healthcheck to use php-fpm-healthcheck - Add curl to production nginx Dockerfile for healthchecks - Add ensureSeedsTable() to SeedRepository for automatic table creation - Update SeedCommand to ensure seeds table exists before operations This prevents 502 Bad Gateway errors during deployment and ensures fresh code is deployed without volume cache issues.
This commit is contained in:
@@ -24,6 +24,9 @@ final readonly class SeedCommand
|
||||
$fresh = $input->hasOption('fresh');
|
||||
|
||||
try {
|
||||
// Ensure seeds table exists (auto-create if missing)
|
||||
$this->seedRepository->ensureSeedsTable();
|
||||
|
||||
// Clear seeds table if --fresh option is provided
|
||||
if ($fresh) {
|
||||
echo "⚠️ Clearing seeds table (--fresh option)...\n";
|
||||
@@ -35,9 +38,10 @@ final readonly class SeedCommand
|
||||
// Run specific seeder
|
||||
echo "Running seeder: {$className}\n";
|
||||
$seeder = $this->seedLoader->load($className);
|
||||
|
||||
|
||||
if ($seeder === null) {
|
||||
echo "❌ Seeder '{$className}' not found or cannot be instantiated.\n";
|
||||
|
||||
return ExitCode::SOFTWARE_ERROR;
|
||||
}
|
||||
|
||||
@@ -50,6 +54,7 @@ final readonly class SeedCommand
|
||||
|
||||
if (empty($seeders)) {
|
||||
echo "No seeders found.\n";
|
||||
|
||||
return ExitCode::SUCCESS;
|
||||
}
|
||||
|
||||
@@ -74,4 +79,3 @@ final readonly class SeedCommand
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user