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
Able to check one container only.
Andras Bacsai9b26a2a859c0
diff --git a/app/Jobs/ContainerStatusJob.php b/app/Jobs/ContainerStatusJob.phpindex b3432d3ec3..d78e49bf94 100644--- a/app/Jobs/ContainerStatusJob.php+++ b/app/Jobs/ContainerStatusJob.php@@ -20,11 +20,11 @@ class ContainerStatusJob implements ShouldQueue{use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;- public function __construct()- {- //+ public function __construct(+ public string|null $container_id = null,+ ) {}- public function handle(): void+ protected function checkAllServers(){try {$servers = Server::all()->reject(fn (Server $server) => $server->settings->is_build_server);@@ -57,4 +57,29 @@ class ContainerStatusJob implements ShouldQueueLog::error($e->getMessage());}}+ protected function checkContainerStatus()+ {+ try {+ $application = Application::where('uuid', $this->container_id)->firstOrFail();+ if (!$application) {+ return;+ }+ if ($application->destination->server) {+ $container = runRemoteCommandSync($application->destination->server, ["docker inspect --format '{{json .State}}' {$this->container_id}"]);+ $container = formatDockerCmdOutputToJson($container);+ $application->status = $container[0]['Status'];+ $application->save();+ }+ } catch (\Exception $e) {+ Log::error($e->getMessage());+ }+ }+ public function handle(): void+ {+ if ($this->container_id) {+ $this->checkContainerStatus();+ } else {+ $this->checkAllServers();+ }+ }}