diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index e38ff1c7d..e0e0f519e 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -482,7 +482,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue if (filled($this->env_filename)) { $services = collect(data_get($composeFile, 'services', [])); $services = $services->map(function ($service, $name) { - $service['env_file'] = ["/artifacts/{$this->env_filename}"]; + $service['env_file'] = [$this->env_filename]; return $service; }); @@ -511,7 +511,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue } else { $command = "{$this->coolify_variables} docker compose"; if (filled($this->env_filename)) { - $command .= " --env-file /artifacts/{$this->env_filename}"; + $command .= " --env-file {$this->workdir}/{$this->env_filename}"; } if ($this->force_rebuild) { $command .= " --project-name {$this->application->uuid} --project-directory {$this->workdir} -f {$this->workdir}{$this->docker_compose_location} build --pull --no-cache"; @@ -557,7 +557,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue $command = "{$this->coolify_variables} docker compose"; if (filled($this->env_filename)) { - $command .= " --env-file /artifacts/{$this->env_filename}"; + $command .= " --env-file {$server_workdir}/{$this->env_filename}"; } $command .= " --project-directory {$server_workdir} -f {$server_workdir}{$this->docker_compose_location} up -d"; $this->execute_remote_command( @@ -574,7 +574,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue $command = "{$this->coolify_variables} docker compose"; if ($this->preserveRepository) { if (filled($this->env_filename)) { - $command .= " --env-file /artifacts/{$this->env_filename}"; + $command .= " --env-file {$server_workdir}/{$this->env_filename}"; } $command .= " --project-name {$this->application->uuid} --project-directory {$server_workdir} -f {$server_workdir}{$this->docker_compose_location} up -d"; $this->write_deployment_configurations(); @@ -584,7 +584,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue ); } else { if (filled($this->env_filename)) { - $command .= " --env-file /artifacts/{$this->env_filename}"; + $command .= " --env-file {$this->workdir}/{$this->env_filename}"; } $command .= " --project-name {$this->application->uuid} --project-directory {$this->workdir} -f {$this->workdir}{$this->docker_compose_location} up -d"; $this->execute_remote_command( @@ -1889,7 +1889,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue ], ]; if (filled($this->env_filename)) { - $docker_compose['services'][$this->container_name]['env_file'] = ["/artifacts/{$this->env_filename}"]; + $docker_compose['services'][$this->container_name]['env_file'] = [$this->env_filename]; } $docker_compose['services'][$this->container_name]['healthcheck'] = [ 'test' => [