refactor: Add default environment to Service model's saveComposeConfigs method
This commit is contained in:
parent
c3fb126a0a
commit
b59799dc2b
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user