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.

fix: remove SERVICE_ from deployable compose

Andras Bacsai1c8f92d3b762
diff --git a/app/Models/Service.php b/app/Models/Service.php
index 8f4e3a72a5..13b7173c13 100644
--- a/app/Models/Service.php
+++ b/app/Models/Service.php
@@ -414,12 +414,7 @@ class Service extends BaseModel
}
$fqdn = "$fqdn$path";
}
- // } else if (substr_count($key->value(), '_') === 3) {
- // if (is_null($value)) {
- // $value = Str::of('/');
- // }
- // $path = $value->value();
- // }
+
if (!$isDatabase) {
if ($savedService->fqdn) {
$fqdn = $savedService->fqdn . ',' . $fqdn;
@@ -557,8 +552,10 @@ class Service extends BaseModel
// Remove unnecessary variables from service.environment
$withoutServiceEnvs = collect([]);
collect(data_get($service, 'environment'))->each(function ($value, $key) use ($withoutServiceEnvs) {
- if (!Str::of($key)->startsWith('$SERVICE_')) {
- $withoutServiceEnvs->put($key, $value);
+ if (!Str::of($key)->startsWith('$SERVICE_') && !Str::of($value)->startsWith('SERVICE_')) {
+ $k = Str::of($value)->before("=");
+ $v = Str::of($value)->after("=");
+ $withoutServiceEnvs->put($k->value(), $v->value());
}
});
data_set($service, 'environment', $withoutServiceEnvs->toArray());