Allow s6 services to start for specific roles like horizon, scheduler, nightwatch, and flux while keeping all as the default.
19 lines
575 B
Bash
19 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 nightwatch && ! coolify_container_has_role nightwatch-agent; then
|
|
echo " INFO Nightwatch is disabled for role '$role', sleeping."
|
|
exec sleep infinity
|
|
fi
|
|
|
|
if grep -qE '^NIGHTWATCH_ENABLED=true' .env 2>/dev/null; then
|
|
echo " INFO Nightwatch is enabled, starting..."
|
|
exec php artisan nightwatch:agent
|
|
fi
|
|
|
|
echo " INFO Nightwatch is disabled, sleeping."
|
|
exec sleep infinity
|