Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix(previews): refine preview domain generation for Docker Compose applications, ensuring correct method usage based on build pack type

Andras Bacsai8a107b3c4bcd
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php
index bc5fab30c6..708d2f15d7 100644
--- a/app/Jobs/ApplicationDeploymentJob.php
+++ b/app/Jobs/ApplicationDeploymentJob.php
@@ -229,7 +229,16 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
// Set preview fqdn
if ($this->pull_request_id !== 0) {
- $this->preview = $this->application->generate_preview_fqdn($this->pull_request_id);
+ if ($this->application->build_pack === 'dockercompose') {
+ // For Docker Compose apps, use the preview model's compose-specific method
+ $this->preview = ApplicationPreview::findPreviewByApplicationAndPullId($this->application->id, $this->pull_request_id);
+ if ($this->preview) {
+ $this->preview->generate_preview_fqdn_compose();
+ }
+ } else {
+ // For non-Docker Compose apps, use the application model's method
+ $this->preview = $this->application->generate_preview_fqdn($this->pull_request_id);
+ }
if ($this->application->is_github_based()) {
ApplicationPullRequestUpdateJob::dispatch(application: $this->application, preview: $this->preview, deployment_uuid: $this->deployment_uuid, status: ProcessStatus::IN_PROGRESS);
}