release/v1.4.3 #168

Merged
myrmidex merged 4 commits from release/v1.4.3 into main 2026-09-26 14:38:00 +02:00
Showing only changes of commit 2244170e1c - Show all commits

View file

@ -67,7 +67,8 @@ EOF
EXPOSE 8000 EXPOSE 8000
# Health check # Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ # start-period must outlast the startup script's 60s database wait.
HEALTHCHECK --interval=30s --timeout=3s --start-period=75s --retries=3 \
CMD curl -f http://localhost:8000/up || exit 1 CMD curl -f http://localhost:8000/up || exit 1
# Create startup script for production # Create startup script for production
@ -77,32 +78,44 @@ set -e
# Wait for database to be ready # Wait for database to be ready
echo "Waiting for database..." echo "Waiting for database..."
db_ready=0
for i in $(seq 1 30); do for i in $(seq 1 30); do
if mysqladmin ping -h "$DB_HOST" -u "$DB_USERNAME" -p"$DB_PASSWORD" --silent 2>/dev/null; then if mysqladmin ping -h "$DB_HOST" -u "$DB_USERNAME" -p"$DB_PASSWORD" --silent 2>/dev/null; then
echo "Database is ready!" echo "Database is ready!"
db_ready=1
break break
fi fi
echo "Waiting for database... ($i/30)" echo "Waiting for database... ($i/30)"
sleep 2 sleep 2
done done
if [ "$db_ready" -ne 1 ]; then
echo "Database unreachable at ${DB_HOST} after 60s; exiting so the restart policy retries." >&2
exit 1
fi
# Cache config with runtime env vars # Cache config with runtime env vars
echo "Caching configuration..." echo "Caching configuration..."
php artisan config:cache php artisan config:cache
# Run migrations # Run migrations. A partial schema is worse than a container that refuses to start.
echo "Running migrations..." echo "Running migrations..."
php artisan migrate --force || echo "Migrations failed or already up-to-date" php artisan migrate --force
# Run seeders (idempotent - uses updateOrInsert) # Run seeders (idempotent - uses updateOrInsert)
echo "Running seeders..." echo "Running seeders..."
php artisan db:seed --force || echo "Seeders failed or already run" php artisan db:seed --force
# Start Horizon in the background # Restart a worker that dies instead of leaving the queue unconsumed.
php artisan horizon & supervise() {
while true; do
"$@" || echo "[supervisor] '$*' exited with $?; restarting in 5s." >&2
sleep 5
done
}
# Start the scheduler in the background supervise php artisan horizon &
php artisan schedule:work & supervise php artisan schedule:work &
# Start FrankenPHP # Start FrankenPHP
exec frankenphp run --config /etc/caddy/Caddyfile exec frankenphp run --config /etc/caddy/Caddyfile