mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-16 02:15:32 +00:00
Allow s6 services to start for specific roles like horizon, scheduler, nightwatch, and flux while keeping all as the default.
20 lines
575 B
Bash
20 lines
575 B
Bash
#!/bin/sh
|
|
|
|
cd /var/www/html
|
|
|
|
. /etc/s6-overlay/scripts/container-role
|
|
role="$(coolify_container_role_value)"
|
|
|
|
if ! coolify_container_has_role worker && ! coolify_container_has_role scheduler && ! coolify_container_has_role scheduler-worker; then
|
|
echo " INFO Scheduler worker is disabled for role '$role', sleeping."
|
|
exec sleep infinity
|
|
fi
|
|
|
|
if grep -qE '^SCHEDULER_ENABLED=false' .env 2>/dev/null; then
|
|
echo " INFO Scheduler is disabled, sleeping."
|
|
exec sleep infinity
|
|
fi
|
|
|
|
echo " INFO Scheduler is enabled, starting..."
|
|
exec php artisan schedule:work
|