Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

refactor: Convert service variables to key-value pairs in parseDockerComposeFile function

Andras Bacsai7d78e0171d26
diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php
index 4e2ba5a9d5..8924f88f76 100644
--- a/bootstrap/helpers/shared.php
+++ b/bootstrap/helpers/shared.php
@@ -1726,6 +1726,21 @@ function parseDockerComposeFile(Service|Application $resource, bool $isNew = fal
data_set($service, 'volumes', $serviceVolumes->toArray());
}
+ // convert - SESSION_SECRET: 123 to - SESSION_SECRET=123
+ $convertedServiceVariables = collect([]);
+ foreach ($serviceVariables as $variableName => $variable) {
+ if (is_numeric($variableName)) {
+ if (is_array($variable)) {
+ $key = str(collect($variable)->keys()->first());
+ $value = str(collect($variable)->values()->first());
+ $variable = "$key=$value";
+ $convertedServiceVariables->put($variableName, $variable);
+ } elseif (is_string($variable)) {
+ $convertedServiceVariables->put($variableName, $variable);
+ }
+ }
+ }
+ $serviceVariables = $convertedServiceVariables;
// Get variables from the service
foreach ($serviceVariables as $variableName => $variable) {
if (is_numeric($variableName)) {