refactor(docker): migrate service startup from Artisan commands to shell scripts

Remove custom Artisan console commands (Horizon, Nightwatch, Scheduler) and
refactor service startup logic directly into s6-overlay shell scripts. Check
environment variables from .env instead of routing through Laravel config.

Services now sleep when disabled instead of exiting immediately. Both
development and production environments updated consistently.
This commit is contained in:
Andras Bacsai committed 2026-03-27 14:12:30 +01:00
1 parent e39678aea5
commit 9b0088072c
9 files changed
+46 -117

No files matched your search

@@ -1,12 +1,11 @@
#!/command/execlineb -P
#!/bin/sh
# Use with-contenv to ensure environment variables are available
with-contenv
cd /var/www/html
foreground {
php
artisan
start:horizon
}
if grep -qE '^HORIZON_ENABLED=false' .env 2>/dev/null; then
echo "horizon: disabled, sleeping."
exec sleep infinity
fi
echo "horizon: enabled, starting..."
exec php artisan horizon
@@ -1,12 +1,11 @@
#!/command/execlineb -P
#!/bin/sh
# Use with-contenv to ensure environment variables are available
with-contenv
cd /var/www/html
foreground {
php
artisan
start:nightwatch
}
if grep -qE '^NIGHTWATCH_ENABLED=true' .env 2>/dev/null; then
echo "nightwatch-agent: enabled, starting..."
exec php artisan nightwatch:agent
fi
echo "nightwatch-agent: disabled, sleeping."
exec sleep infinity
@@ -1,13 +1,11 @@
#!/command/execlineb -P
#!/bin/sh
# Use with-contenv to ensure environment variables are available
with-contenv
cd /var/www/html
foreground {
php
artisan
start:scheduler
}
if grep -qE '^SCHEDULER_ENABLED=false' .env 2>/dev/null; then
echo "scheduler-worker: disabled, sleeping."
exec sleep infinity
fi
echo "scheduler-worker: enabled, starting..."
exec php artisan schedule:work
@@ -1,11 +1,11 @@
#!/command/execlineb -P
#!/bin/sh
# Use with-contenv to ensure environment variables are available
with-contenv
cd /var/www/html
foreground {
php
artisan
start:horizon
}
if grep -qE '^HORIZON_ENABLED=false' .env 2>/dev/null; then
echo "horizon: disabled, sleeping."
exec sleep infinity
fi
echo "horizon: enabled, starting..."
exec php artisan horizon
@@ -1,11 +1,11 @@
#!/command/execlineb -P
#!/bin/sh
# Use with-contenv to ensure environment variables are available
with-contenv
cd /var/www/html
foreground {
php
artisan
start:nightwatch
}
if grep -qE '^NIGHTWATCH_ENABLED=true' .env 2>/dev/null; then
echo "nightwatch-agent: enabled, starting..."
exec php artisan nightwatch:agent
fi
echo "nightwatch-agent: disabled, sleeping."
exec sleep infinity
@@ -1,10 +1,11 @@
#!/command/execlineb -P
#!/bin/sh
# Use with-contenv to ensure environment variables are available
with-contenv
cd /var/www/html
foreground {
php
artisan
start:scheduler
}
if grep -qE '^SCHEDULER_ENABLED=false' .env 2>/dev/null; then
echo "scheduler-worker: disabled, sleeping."
exec sleep infinity
fi
echo "scheduler-worker: enabled, starting..."
exec php artisan schedule:work