2023-03-01 17:32:51 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
rm -f /var/lock/laravel_horizon_started
|
|
|
|
|
|
|
|
# If horizon is present, publish the frontend assets, if HORIZON_UI is set to "on"
|
2024-02-07 15:21:14 +00:00
|
|
|
if [[ ${HORIZON_ENABLE,,} == "on" ]]; then
|
|
|
|
if [[ -f "/app/config/horizon.php" ]]; then
|
|
|
|
if [[ ${MIGRATE_ENABLE} == "on" ]]; then
|
|
|
|
echo "[HORIZON] Waiting until Migration Complete."
|
|
|
|
until [[ -f /var/lock/laravel_migration_complete ]]; do
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo "[HORIZON] Migration is complete, running Horizon."
|
|
|
|
fi
|
|
|
|
if [[ ${HORIZON_UI,,} == "on" ]]; then
|
|
|
|
echo "[HORIZON] Publishing horizon frontend assets"
|
|
|
|
php /app/artisan horizon:publish
|
|
|
|
fi
|
|
|
|
echo "[HORIZON] Running laravel horizon runner"
|
|
|
|
cpulimit -l 30 -- php /app/artisan horizon
|
|
|
|
touch /var/lock/laravel_horizon_started
|
|
|
|
else
|
|
|
|
echo "[HORIZON] Horizon is not present."
|
|
|
|
fi
|
2023-03-01 17:32:51 +00:00
|
|
|
else
|
2024-02-07 15:21:14 +00:00
|
|
|
echo "[HORIZON] Not enabled. To enable this feature, set HORIZON_ENABLE = on."
|
2023-03-01 17:32:51 +00:00
|
|
|
fi
|
2023-03-02 15:41:01 +00:00
|
|
|
|
2023-03-01 17:32:51 +00:00
|
|
|
sleep infinity
|