Fix network connection issues in Server and Service models

This commit is contained in:
Andras Bacsai
2023-11-27 09:58:31 +01:00
parent 8d0c3abf2e
commit fae97e4dee
4 changed files with 99 additions and 3 deletions

View File

@@ -12,10 +12,16 @@ function get_proxy_path()
}
function connectProxyToNetworks(Server $server)
{
// TODO: Connect to service + compose based application networks as well.
// TODO: Connect to compose based application networks as well.
// Standalone networks
$networks = collect($server->standaloneDockers)->map(function ($docker) {
return $docker['network'];
})->unique();
});
// Service networks
foreach($server->services()->get() as $service) {
$networks->push($service->networks());
}
$networks = collect($networks)->flatten()->unique();
if ($networks->count() === 0) {
$networks = collect(['coolify']);
}