diff --git a/app/Livewire/Server/ValidateAndInstall.php b/app/Livewire/Server/ValidateAndInstall.php index e5d2a4b39..ca81487a8 100644 --- a/app/Livewire/Server/ValidateAndInstall.php +++ b/app/Livewire/Server/ValidateAndInstall.php @@ -14,6 +14,7 @@ class ValidateAndInstall extends Component public $uptime = null; public $supported_os_type = null; public $docker_installed = null; + public $docker_compose_installed = null; public $docker_version = null; public $error = null; @@ -67,9 +68,9 @@ class ValidateAndInstall extends Component public function validateDockerEngine() { $this->docker_installed = $this->server->validateDockerEngine(); - if (!$this->docker_installed) { + $this->docker_compose_installed = $this->server->validateDockerCompose(); + if (!$this->docker_installed || !$this->docker_compose_installed) { if ($this->install) { - ray($this->number_of_tries, $this->max_tries); if ($this->number_of_tries == $this->max_tries) { $this->error = 'Docker Engine could not be installed. Please install Docker manually before continuing: documentation.'; return; diff --git a/app/Models/Server.php b/app/Models/Server.php index bdbb0309d..e4a7b895a 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -443,6 +443,21 @@ class Server extends BaseModel $this->validateCoolifyNetwork(isSwarm: false, isBuildServer: $this->settings->is_build_server); return true; } + public function validateDockerCompose($throwError = false) + { + $dockerCompose = instant_remote_process(["docker compose version"], $this, false); + if (is_null($dockerCompose)) { + $this->settings->is_usable = false; + $this->settings->save(); + if ($throwError) { + throw new \Exception('Server is not usable. Docker Compose is not installed.'); + } + return false; + } + $this->settings->is_usable = true; + $this->settings->save(); + return true; + } public function validateDockerSwarm() { $swarmStatus = instant_remote_process(["docker info|grep -i swarm"], $this, false); diff --git a/resources/views/livewire/server/validate-and-install.blade.php b/resources/views/livewire/server/validate-and-install.blade.php index 9eaa33d9b..2931f7d65 100644 --- a/resources/views/livewire/server/validate-and-install.blade.php +++ b/resources/views/livewire/server/validate-and-install.blade.php @@ -68,6 +68,28 @@