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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: able to support more database dynamically from Coolify's UI
Andras Bacsaief448280d8df
diff --git a/app/Models/Service.php b/app/Models/Service.phpindex c9c086622f..41411ac704 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -770,9 +770,34 @@ class Service extends BaseModel}$fields->put('Code Server', $data->toArray());break;+ case str($image)->contains('elestio/strapi'):+ $data = collect([]);+ $license = $this->environment_variables()->where('key', 'STRAPI_LICENSE')->first();+ if ($license) {+ $data = $data->merge([+ 'License' => [+ 'key' => data_get($license, 'key'),+ 'value' => data_get($license, 'value'),+ ],+ ]);+ }+ $nodeEnv = $this->environment_variables()->where('key', 'NODE_ENV')->first();+ if ($nodeEnv) {+ $data = $data->merge([+ 'Node Environment' => [+ 'key' => data_get($nodeEnv, 'key'),+ 'value' => data_get($nodeEnv, 'value'),+ ],+ ]);+ }++ $fields->put('Strapi', $data->toArray());+ break;+}}$databases = $this->databases()->get();+ ray($databases);foreach ($databases as $database) {$image = str($database->image)->before(':')->value();@@ -1108,7 +1133,6 @@ class Service extends BaseModel$real_value = escapeEnvVariables($env->real_value);}}- ray("echo \"{$env->key}={$real_value}\" >> .env");$commands[] = "echo \"{$env->key}={$real_value}\" >> .env";}}diff --git a/bootstrap/helpers/constants.php b/bootstrap/helpers/constants.phpindex 1eeec8f949..073a44fd8a 100644--- a/bootstrap/helpers/constants.php+++ b/bootstrap/helpers/constants.php@@ -34,6 +34,7 @@ const DATABASE_DOCKER_IMAGES = ['influxdb','clickhouse/clickhouse-server','supabase/postgres',+ 'elestio/postgres',];const SPECIFIC_SERVICES = ['quay.io/minio/minio',diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.phpindex 6ca1a71742..b46cc0f5d3 100644--- a/bootstrap/helpers/shared.php+++ b/bootstrap/helpers/shared.php@@ -2984,11 +2984,22 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int$predefinedPort = '8000';}if ($isDatabase) {- $savedService = ServiceDatabase::firstOrCreate([- 'name' => $serviceName,- 'image' => $image,- 'service_id' => $resource->id,- ]);+ $applicationFound = ServiceApplication::where('name', $serviceName)->where('image', $image)->where('service_id', $resource->id)->first();+ if ($applicationFound) {+ $savedService = $applicationFound;+ $savedService = ServiceDatabase::firstOrCreate([+ 'name' => $applicationFound->name,+ 'image' => $applicationFound->image,+ 'service_id' => $applicationFound->service_id,+ ]);+ $applicationFound->delete();+ } else {+ $savedService = ServiceDatabase::firstOrCreate([+ 'name' => $serviceName,+ 'image' => $image,+ 'service_id' => $resource->id,+ ]);+ }} else {$savedService = ServiceApplication::firstOrCreate(['name' => $serviceName,@@ -3209,12 +3220,24 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?intif ($serviceName === 'plausible') {$predefinedPort = '8000';}+if ($isDatabase) {- $savedService = ServiceDatabase::firstOrCreate([- 'name' => $serviceName,- 'image' => $image,- 'service_id' => $resource->id,- ]);+ $applicationFound = ServiceApplication::where('name', $serviceName)->where('image', $image)->where('service_id', $resource->id)->first();+ if ($applicationFound) {+ $savedService = $applicationFound;+ $savedService = ServiceDatabase::firstOrCreate([+ 'name' => $applicationFound->name,+ 'image' => $applicationFound->image,+ 'service_id' => $applicationFound->service_id,+ ]);+ $applicationFound->delete();+ } else {+ $savedService = ServiceDatabase::firstOrCreate([+ 'name' => $serviceName,+ 'image' => $image,+ 'service_id' => $resource->id,+ ]);+ }} else {$savedService = ServiceApplication::firstOrCreate(['name' => $serviceName,