From 893339fc8e80b02820a186db30842fe686792768 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Jul 2024 16:39:28 +0200 Subject: [PATCH] refactor: Update Docker Compose build command to include --pull flag --- app/Jobs/ApplicationDeploymentJob.php | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 656b1f040..ac48945f5 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -462,7 +462,7 @@ private function deploy_docker_compose_buildpack() if ($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} build"; + $command .= " --project-name {$this->application->uuid} --project-directory {$this->workdir} -f {$this->workdir}{$this->docker_compose_location} build --pull"; $this->execute_remote_command( [executeInDocker($this->deployment_uuid, $command), 'hidden' => true], ); @@ -2031,23 +2031,6 @@ private function stop_running_container(bool $force = false) } } - private function build_by_compose_file() - { - $this->application_deployment_queue->addLogEntry('Pulling & building required images.'); - if ($this->application->build_pack === 'dockerimage') { - $this->application_deployment_queue->addLogEntry('Pulling latest images from the registry.'); - $this->execute_remote_command( - [executeInDocker($this->deployment_uuid, "docker compose --project-name {$this->application->uuid} --project-directory {$this->workdir} pull"), 'hidden' => true], - [executeInDocker($this->deployment_uuid, "{$this->coolify_variables} docker compose --project-name {$this->application->uuid} --project-directory {$this->workdir} build"), 'hidden' => true], - ); - } else { - $this->execute_remote_command( - [executeInDocker($this->deployment_uuid, "{$this->coolify_variables} docker compose --project-name {$this->application->uuid} --project-directory {$this->workdir} -f {$this->workdir}{$this->docker_compose_location} build"), 'hidden' => true], - ); - } - $this->application_deployment_queue->addLogEntry('New images built.'); - } - private function start_by_compose_file() { if ($this->application->build_pack === 'dockerimage') {