From c3fb126a0a593cb6e729a1a66e629eeb1fcff20f Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 24 Jun 2024 20:55:12 +0200 Subject: [PATCH] refactor: Update Service model's saveComposeConfigs method --- app/Livewire/Project/Service/StackForm.php | 1 - app/Models/Service.php | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Livewire/Project/Service/StackForm.php b/app/Livewire/Project/Service/StackForm.php index a1b613a43..3f62202c8 100644 --- a/app/Livewire/Project/Service/StackForm.php +++ b/app/Livewire/Project/Service/StackForm.php @@ -81,7 +81,6 @@ public function submit() return handleError($e, $this); } finally { if (is_null($this->service->config_hash)) { - ray('asdf'); $this->service->isConfigurationChanged(true); } else { $this->dispatch('configurationChanged'); diff --git a/app/Models/Service.php b/app/Models/Service.php index c608e38dd..c345b2b8b 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -842,7 +842,7 @@ public function saveComposeConfigs() $envs_from_coolify = $this->environment_variables()->get(); foreach ($json['services'] as $service => $config) { $envs = collect($config['environment']); - $envs->push("COOLIFY_CONTAINER_NAME=$service-{$this->uuid}"); + $envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}"); foreach ($envs_from_coolify as $env) { $envs = $envs->map(function ($value) use ($env) { if (str($value)->startsWith($env->key)) { @@ -855,7 +855,6 @@ public function saveComposeConfigs() $envs = $envs->unique(); data_set($json, "services.$service.environment", $envs->toArray()); } - $this->docker_compose = Yaml::dump($json, 10, 2, Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK); $docker_compose_base64 = base64_encode($this->docker_compose);