From 18a14037c74aa517c2156d194af00d3d2a1167ec Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 10 Nov 2025 14:56:27 +0100 Subject: [PATCH] fix: improve logging for PORT environment variable mismatch and ensure .env file is created in the correct directory --- app/Jobs/ApplicationDeploymentJob.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index d6746b4d1..7553ec987 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -1173,7 +1173,10 @@ private function generate_runtime_environment_variables() if ($this->build_pack !== 'dockercompose') { $detectedPort = $this->application->detectPortFromEnvironment(false); if ($detectedPort && ! empty($ports) && ! in_array($detectedPort, $ports)) { - ray()->orange("PORT environment variable ({$detectedPort}) does not match configured ports_exposes: ".implode(',', $ports)); + $this->application_deployment_queue->addLogEntry( + "Warning: PORT environment variable ({$detectedPort}) does not match configured ports_exposes: ".implode(',', $ports).'. It could case "bad gateway" or "no server" errors. Check the "General" page to fix it.', + 'stderr' + ); } } @@ -3062,7 +3065,6 @@ private function start_by_compose_file() { // Ensure .env file exists before docker compose tries to load it (defensive programming) $this->execute_remote_command( - ["touch {$this->workdir}/.env", 'hidden' => true], ["touch {$this->configuration_dir}/.env", 'hidden' => true], );