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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: use port exposed for reverse proxy
Andras Bacsai8082dc1a0158
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex f4b839ec31..33324620a3 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -620,7 +620,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted'container_name' => $this->container_name,'restart' => RESTART_MODE,'environment' => $environment_variables,- 'labels' => generateLabelsApplication($this->application, $this->preview),+ 'labels' => generateLabelsApplication($this->application, $this->preview, $ports),'expose' => $ports,'networks' => [$this->destination->network,diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.phpindex 2b779480f9..adf1761f10 100644--- a/bootstrap/helpers/docker.php+++ b/bootstrap/helpers/docker.php@@ -147,7 +147,7 @@ function defaultLabels($id, $name, $pull_request_id = 0, string $type = 'applica}return $labels;}-function fqdnLabelsForTraefik(Collection $domains, bool $is_force_https_enabled)+function fqdnLabelsForTraefik(Collection $domains, bool $is_force_https_enabled, $onlyPort = null){$labels = collect([]);$labels->push('traefik.enable=true');@@ -158,7 +158,9 @@ function fqdnLabelsForTraefik(Collection $domains, bool $is_force_https_enabled)$path = $url->getPath();$schema = $url->getScheme();$port = $url->getPort();-+ if (is_null($port) && !is_null($onlyPort)) {+ $port = $onlyPort;+ }$http_label = "{$uuid}-http";$https_label = "{$uuid}-https";@@ -203,9 +205,12 @@ function fqdnLabelsForTraefik(Collection $domains, bool $is_force_https_enabled)return $labels;}-function generateLabelsApplication(Application $application, ?ApplicationPreview $preview = null): array+function generateLabelsApplication(Application $application, ?ApplicationPreview $preview = null, $ports): array{-+ $onlyPort = null;+ if (count($ports) === 1) {+ $onlyPort = $ports[0];+ }$pull_request_id = data_get($preview, 'pull_request_id', 0);$container_name = generateApplicationContainerName($application, $pull_request_id);$appId = $application->id;@@ -221,7 +226,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview$domains = Str::of(data_get($application, 'fqdn'))->explode(',');}// Add Traefik labels no matter which proxy is selected- $labels = $labels->merge(fqdnLabelsForTraefik($domains, $application->settings->is_force_https_enabled));+ $labels = $labels->merge(fqdnLabelsForTraefik($domains, $application->settings->is_force_https_enabled,$onlyPort));}return $labels->all();}