Fix environment variable parsing in Docker Compose file
This commit is contained in:
		| @@ -1275,13 +1275,18 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal | |||||||
|                     continue; |                     continue; | ||||||
|                 } |                 } | ||||||
|                 if ($value?->startsWith('$')) { |                 if ($value?->startsWith('$')) { | ||||||
|  |                     $foundEnv = EnvironmentVariable::where([ | ||||||
|  |                         'key' => $key, | ||||||
|  |                         'service_id' => $resource->id, | ||||||
|  |                     ])->first(); | ||||||
|                     $value = Str::of(replaceVariables($value)); |                     $value = Str::of(replaceVariables($value)); | ||||||
|                     $key = $value; |                     $key = $value; | ||||||
|  | 
 | ||||||
|  |                     if ($value->startsWith('SERVICE_')) { | ||||||
|                         $foundEnv = EnvironmentVariable::where([ |                         $foundEnv = EnvironmentVariable::where([ | ||||||
|                             'key' => $key, |                             'key' => $key, | ||||||
|                             'application_id' => $resource->id, |                             'application_id' => $resource->id, | ||||||
|                         ])->first(); |                         ])->first(); | ||||||
|                     if ($value->startsWith('SERVICE_')) { |  | ||||||
|                         ['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value); |                         ['command' => $command, 'forService' => $forService, 'generatedValue' => $generatedValue, 'port' => $port] = parseEnvVariable($value); | ||||||
|                         if ($command->value() === 'FQDN' || $command->value() === 'URL') { |                         if ($command->value() === 'FQDN' || $command->value() === 'URL') { | ||||||
|                             if (Str::lower($forService) === $serviceName) { |                             if (Str::lower($forService) === $serviceName) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Andras Bacsai
					Andras Bacsai