Skip to content

Commit 8335c29

Browse files
authored
Merge pull request coollabsio#2670 from coollabsio/next
fix fix fix
2 parents f0b2f6e + feadc60 commit 8335c29

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/Models/Service.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,12 @@ public function saveComposeConfigs()
841841
$json = Yaml::parse($this->docker_compose);
842842
$envs_from_coolify = $this->environment_variables()->get();
843843
foreach ($json['services'] as $service => $config) {
844-
$envs = collect($config['environment']);
844+
if (data_get($config, 'environment') === null) {
845+
data_set($json, "services.$service.environment", []);
846+
$envs = collect([]);
847+
} else {
848+
$envs = collect($config['environment']);
849+
}
845850
$envs->put('COOLIFY_CONTAINER_NAME', "$service-{$this->uuid}");
846851
foreach ($envs_from_coolify as $env) {
847852
$envs = $envs->map(function ($value) use ($env) {

0 commit comments

Comments
 (0)