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: applications with port mappins do a normal update (not rolling update)
Andras Bacsaib02e5d3f27e5
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex a4c37a0849..eeabb185f8 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -284,9 +284,20 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncryptedprivate function rolling_update(){- $this->start_by_compose_file();- $this->health_check();- $this->stop_running_container();+ if (count($this->application->ports_mappings_array) > 0){+ $this->execute_remote_command(+ ["echo -n 'Application has ports mapped to the host system, rolling update is not supported. Stopping current container.'"],+ );+ $this->stop_running_container(force: true);+ $this->start_by_compose_file();+ } else {+ $this->execute_remote_command(+ ["echo -n 'Rolling update started.'"],+ );+ $this->start_by_compose_file();+ $this->health_check();+ $this->stop_running_container();+ }}private function health_check(){@@ -704,10 +715,10 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");}}- private function stop_running_container()+ private function stop_running_container(bool $force = false){if ($this->currently_running_container_name) {- if ($this->newVersionIsHealthy) {+ if ($this->newVersionIsHealthy || $force) {$this->execute_remote_command(["echo -n 'Removing old version of your application.'"],[executeInDocker($this->deployment_uuid, "docker rm -f $this->currently_running_container_name >/dev/null 2>&1"), "hidden" => true],@@ -724,7 +735,7 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");private function start_by_compose_file(){$this->execute_remote_command(- ["echo -n 'Rolling update started.'"],+ ["echo -n 'Starting application (could take a while).'"],[executeInDocker($this->deployment_uuid, "docker compose --project-directory {$this->workdir} up -d >/dev/null"), "hidden" => true],);}diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.phpindex a0089079ad..5d789edcfe 100644--- a/resources/views/livewire/project/application/general.blade.php+++ b/resources/views/livewire/project/application/general.blade.php@@ -63,7 +63,7 @@helper="A comma separated list of ports your application uses. The first port will be used as default healthcheck port if nothing defined in the Healthcheck menu. Be sure to set this correctly." />@endif<x-forms.input placeholder="3000:3000" id="application.ports_mappings" label="Ports Mappings"- helper="A comma separated list of ports you would like to map to the host system. Useful when you do not want to use domains.<br><span class='inline-block font-bold text-warning'>Example</span>3000:3000,3002:3002" />+ helper="A comma separated list of ports you would like to map to the host system. Useful when you do not want to use domains.<br><br><span class='inline-block font-bold text-warning'>Example:</span><br>3000:3000,3002:3002<br><br>Rolling update is not supported if you have a port mapped to the host." /></div></div><h3>Advanced</h3>