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 nixpacks predefined build variables, but still could update the default values from Coolify
Andras Bacsaif2c7fbf55ff9
diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex 7e4155338d..12005ce60e 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -126,6 +126,8 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueueprivate ?string $nixpacks_plan = null;+ private Collection $nixpacks_plan_json;+private ?string $nixpacks_type = null;private string $dockerfile_location = '/Dockerfile';@@ -1545,7 +1547,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue// Do any modifications here$this->generate_env_variables();- $merged_envs = $this->env_args->merge(collect(data_get($parsed, 'variables', [])));+ $merged_envs = collect(data_get($parsed, 'variables', []))->merge($this->env_args);$aptPkgs = data_get($parsed, 'phases.setup.aptPkgs', []);if (count($aptPkgs) === 0) {$aptPkgs = ['curl', 'wget'];@@ -1570,6 +1572,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$this->elixir_finetunes();}$this->nixpacks_plan = json_encode($parsed, JSON_PRETTY_PRINT);+ $this->nixpacks_plan_json = collect($parsed);$this->application_deployment_queue->addLogEntry("Final Nixpacks plan: {$this->nixpacks_plan}", hidden: true);if ($this->nixpacks_type === 'rust') {// temporary: disable healthcheck for rust because the start phase does not have curl/wget@@ -2278,18 +2281,10 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");private function generate_build_env_variables(){- $this->build_args = collect(["--build-arg SOURCE_COMMIT=\"{$this->commit}\""]);- if ($this->pull_request_id === 0) {- foreach ($this->application->build_environment_variables as $env) {- $value = escapeshellarg($env->real_value);- $this->build_args->push("--build-arg {$env->key}={$value}");- }- } else {- foreach ($this->application->build_environment_variables_preview as $env) {- $value = escapeshellarg($env->real_value);- $this->build_args->push("--build-arg {$env->key}={$value}");- }- }+ $variables = collect($this->nixpacks_plan_json->get('variables'));+ $this->build_args = $variables->map(function ($value, $key) {+ return "--build-arg {$key}={$value}";+ });}private function add_build_env_variables_to_dockerfile()