coolify/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/run
Andras Bacsai 762daf83a1 feat(container): support comma-separated roles
Allow s6 services to start for specific roles like horizon,
scheduler, nightwatch, and flux while keeping all as the default.
2026-06-15 23:36:47 +02:00

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