From 33ae10a6dcef0e0c937c3211dd999ae24a3ea88d Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 18 Dec 2024 10:44:56 +0100 Subject: [PATCH] fix --- app/Actions/Database/StartPostgresql.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.php index adf0623f3..ebfe61f82 100644 --- a/app/Actions/Database/StartPostgresql.php +++ b/app/Actions/Database/StartPostgresql.php @@ -23,6 +23,9 @@ public function handle(StandalonePostgresql $database) $this->database = $database; $container_name = $this->database->uuid; $this->configuration_dir = database_configuration_dir().'/'.$container_name; + if (isDev()) { + $this->configuration_dir = '/var/lib/docker/volumes/coolify_dev_coolify_data/_data/databases/'.$container_name; + } $this->commands = [ "echo 'Starting database.'", @@ -78,7 +81,7 @@ public function handle(StandalonePostgresql $database) ], ], ]; - if (! is_null($this->database->limits_cpuset)) { + if (filled($this->database->limits_cpuset)) { data_set($docker_compose, "services.{$container_name}.cpuset", $this->database->limits_cpuset); } if ($this->database->destination->server->isLogDrainEnabled() && $this->database->isLogDrainEnabled()) { @@ -108,7 +111,7 @@ public function handle(StandalonePostgresql $database) ]; } } - if (! is_null($this->database->postgres_conf) && ! empty($this->database->postgres_conf)) { + if (filled($this->database->postgres_conf)) { $docker_compose['services'][$container_name]['volumes'][] = [ 'type' => 'bind', 'source' => $this->configuration_dir.'/custom-postgres.conf', @@ -201,7 +204,7 @@ private function generate_init_scripts() { $this->commands[] = "rm -rf $this->configuration_dir/docker-entrypoint-initdb.d/*"; - if (is_null($this->database->init_scripts) || count($this->database->init_scripts) === 0) { + if (blank($this->database->init_scripts) || count($this->database->init_scripts) === 0) { return; } @@ -219,7 +222,7 @@ private function add_custom_conf() $filename = 'custom-postgres.conf'; $config_file_path = "$this->configuration_dir/$filename"; - if (is_null($this->database->postgres_conf) || empty($this->database->postgres_conf)) { + if (blank($this->database->postgres_conf)) { $this->commands[] = "rm -f $config_file_path"; return;