diff --git a/app/Models/Service.php b/app/Models/Service.php index c345b2b8b..82e1b6c8f 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -841,6 +841,9 @@ public function saveComposeConfigs() $json = Yaml::parse($this->docker_compose); $envs_from_coolify = $this->environment_variables()->get(); foreach ($json['services'] as $service => $config) { + if (data_get($config, 'environment') === null) { + data_set($json, "services.$service.environment", []); + } $envs = collect($config['environment']); $envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}"); foreach ($envs_from_coolify as $env) {