From 87ab4bd71e90e6b9095ea925d78292f566f86be7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 9 Nov 2023 15:05:42 +0100 Subject: [PATCH] fix: local ip address --- app/Models/ServiceDatabase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/ServiceDatabase.php b/app/Models/ServiceDatabase.php index 313a828b7..0dbbf6196 100644 --- a/app/Models/ServiceDatabase.php +++ b/app/Models/ServiceDatabase.php @@ -31,7 +31,11 @@ class ServiceDatabase extends BaseModel public function getServiceDatabaseUrl() { // $type = $this->databaseType(); $port = $this->public_port; - $url = "{$this->service->server->ip}:{$port}"; + $realIp = $this->service->server->ip; + if ($realIp === 'host.docker.internal' || isDev()) { + $realIp = base_ip(); + } + $url = "{$realIp}:{$port}"; return $url; } public function service()