Add Docker Compose based applications and preview deployments to proxy on restart

This commit is contained in:
Andras Bacsai
2023-11-28 12:48:55 +01:00
parent d058e04213
commit 2788fcf4e1
3 changed files with 36 additions and 3 deletions

View File

@@ -228,6 +228,23 @@ class Server extends BaseModel
return $standaloneDocker->applications;
})->flatten();
}
public function dockerComposeBasedApplications()
{
return $this->applications()->filter(function ($application) {
return data_get($application, 'build_pack') === 'dockercompose';
});
}
public function dockerComposeBasedPreviewDeployments()
{
return $this->previews()->filter(function ($preview) {
$applicationId = data_get($preview, 'application_id');
$application = Application::find($applicationId);
if (!$application) {
return false;
}
return data_get($application, 'build_pack') === 'dockercompose';
});
}
public function services()
{
return $this->hasMany(Service::class);