An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor(docker): migrate service startup from Artisan commands to shell scripts
Andras Bacsai9b0088072cd2
diff --git a/app/Console/Commands/Horizon.php b/app/Console/Commands/Horizon.phpdeleted file mode 100644index d3e35ca5a1..0000000000--- a/app/Console/Commands/Horizon.php+++ /dev/null@@ -1,23 +0,0 @@-<?php--namespace App\Console\Commands;--use Illuminate\Console\Command;--class Horizon extends Command-{- protected $signature = 'start:horizon';-- protected $description = 'Start Horizon';-- public function handle()- {- if (config('constants.horizon.is_horizon_enabled')) {- $this->info('Horizon is enabled on this server.');- $this->call('horizon');- exit(0);- } else {- exit(0);- }- }-}diff --git a/app/Console/Commands/Nightwatch.php b/app/Console/Commands/Nightwatch.phpdeleted file mode 100644index 40fd86a81e..0000000000--- a/app/Console/Commands/Nightwatch.php+++ /dev/null@@ -1,22 +0,0 @@-<?php--namespace App\Console\Commands;--use Illuminate\Console\Command;--class Nightwatch extends Command-{- protected $signature = 'start:nightwatch';-- protected $description = 'Start Nightwatch';-- public function handle(): void- {- if (config('constants.nightwatch.is_nightwatch_enabled')) {- $this->info('Nightwatch is enabled on this server.');- $this->call('nightwatch:agent');- }-- exit(0);- }-}diff --git a/app/Console/Commands/Scheduler.php b/app/Console/Commands/Scheduler.phpdeleted file mode 100644index ee64368c3d..0000000000--- a/app/Console/Commands/Scheduler.php+++ /dev/null@@ -1,23 +0,0 @@-<?php--namespace App\Console\Commands;--use Illuminate\Console\Command;--class Scheduler extends Command-{- protected $signature = 'start:scheduler';-- protected $description = 'Start Scheduler';-- public function handle()- {- if (config('constants.horizon.is_scheduler_enabled')) {- $this->info('Scheduler is enabled on this server.');- $this->call('schedule:work');- exit(0);- } else {- exit(0);- }- }-}diff --git a/docker/development/etc/s6-overlay/s6-rc.d/horizon/run b/docker/development/etc/s6-overlay/s6-rc.d/horizon/runindex ada19b3a30..e6a17f858b 100644--- a/docker/development/etc/s6-overlay/s6-rc.d/horizon/run+++ b/docker/development/etc/s6-overlay/s6-rc.d/horizon/run@@ -1,12 +1,11 @@-#!/command/execlineb -P+#!/bin/sh-# Use with-contenv to ensure environment variables are available-with-contenvcd /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 horizondiff --git a/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/run b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/runindex 1166ccd089..80b421c925 100644--- a/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/run+++ b/docker/development/etc/s6-overlay/s6-rc.d/nightwatch-agent/run@@ -1,12 +1,11 @@-#!/command/execlineb -P+#!/bin/sh-# Use with-contenv to ensure environment variables are available-with-contenvcd /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 infinitydiff --git a/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run b/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/runindex b81a448338..6c4d2be9f4 100644--- a/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run+++ b/docker/development/etc/s6-overlay/s6-rc.d/scheduler-worker/run@@ -1,13 +1,11 @@-#!/command/execlineb -P+#!/bin/sh-# Use with-contenv to ensure environment variables are available-with-contenvcd /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:workdiff --git a/docker/production/etc/s6-overlay/s6-rc.d/horizon/run b/docker/production/etc/s6-overlay/s6-rc.d/horizon/runindex be66476079..e6a17f858b 100644--- a/docker/production/etc/s6-overlay/s6-rc.d/horizon/run+++ b/docker/production/etc/s6-overlay/s6-rc.d/horizon/run@@ -1,11 +1,11 @@-#!/command/execlineb -P+#!/bin/sh-# Use with-contenv to ensure environment variables are available-with-contenvcd /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 horizondiff --git a/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/run b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/runindex 80d73eadb8..80b421c925 100644--- a/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/run+++ b/docker/production/etc/s6-overlay/s6-rc.d/nightwatch-agent/run@@ -1,11 +1,11 @@-#!/command/execlineb -P+#!/bin/sh-# Use with-contenv to ensure environment variables are available-with-contenvcd /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 infinitydiff --git a/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run b/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/runindex a2ecb0a73c..6c4d2be9f4 100644--- a/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run+++ b/docker/production/etc/s6-overlay/s6-rc.d/scheduler-worker/run@@ -1,10 +1,11 @@-#!/command/execlineb -P+#!/bin/sh-# Use with-contenv to ensure environment variables are available-with-contenvcd /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