add env vars for db services 😢

This commit is contained in:
Vahor committed 2024-08-27 18:57:02 +02:00
1 parent eb22155dcc
commit a245d16e05
7 files changed
+105

No files matched your search

+15
View File
@@ -199,6 +199,21 @@ class StartPostgresql
$environment_variables->push("POSTGRES_DB={$this->database->postgres_db}");
}
// TODO: move this in a shared function
if ($environment_variables->where('key', 'COOLIFY_APP_NAME')->isEmpty()) {
$environment_variables->push("COOLIFY_APP_NAME={$this->database->name}");
}
if ($environment_variables->where('key', 'COOLIFY_SERVER_IP')->isEmpty()) {
$environment_variables->push("COOLIFY_SERVER_IP={$this->database->destination->server->ip}");
}
if ($environment_variables->where('key', 'COOLIFY_ENVIRONMENT_NAME')->isEmpty()) {
$environment_variables->push("COOLIFY_ENVIRONMENT_NAME={$this->database->environment->name}");
}
if ($environment_variables->where('key', 'COOLIFY_PROJECT_NAME')->isEmpty()) {
$environment_variables->push("COOLIFY_PROJECT_NAME={$this->database->project()->name}");
}
return $environment_variables->all();
}