fix: local ip address

This commit is contained in:
Andras Bacsai 2023-11-09 15:05:42 +01:00
parent 61e1fdede9
commit 87ab4bd71e

View File

@ -31,7 +31,11 @@ class ServiceDatabase extends BaseModel
public function getServiceDatabaseUrl() { public function getServiceDatabaseUrl() {
// $type = $this->databaseType(); // $type = $this->databaseType();
$port = $this->public_port; $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; return $url;
} }
public function service() public function service()