diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.php index 0e3983f7e..73cf55fcd 100644 --- a/app/Http/Controllers/ProjectController.php +++ b/app/Http/Controllers/ProjectController.php @@ -81,7 +81,9 @@ public function new() $oneClickService = data_get($services, "$oneClickServiceName.compose"); $oneClickDotEnvs = data_get($services, "$oneClickServiceName.envs", null); if ($oneClickDotEnvs) { - $oneClickDotEnvs = Str::of(base64_decode($oneClickDotEnvs))->split('/\r\n|\r|\n/'); + $oneClickDotEnvs = Str::of(base64_decode($oneClickDotEnvs))->split('/\r\n|\r|\n/')->filter(function ($value) { + return !empty($value); + }); } if ($oneClickService) { $destination = StandaloneDocker::whereUuid($destination_uuid)->first(); diff --git a/app/Models/Service.php b/app/Models/Service.php index 5b4d5fc09..da3e81cbe 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -118,7 +118,7 @@ public function saveComposeConfigs() public function parse(bool $isNew = false): Collection { - ray()->clearAll(); + // ray()->clearAll(); if ($this->docker_compose_raw) { try { $yaml = Yaml::parse($this->docker_compose_raw); @@ -260,7 +260,7 @@ public function parse(bool $isNew = false): Collection $networks = $serviceNetworks->toArray(); foreach ($definedNetwork as $key => $network) { $networks = array_merge($networks, [ - $network => null + $network ]); } data_set($service, 'networks', $networks);