From 6379123f93a6b792a906c55999754411e2130f1d Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:30:34 +0100 Subject: [PATCH] fix(deployment): Remove redundant docker rm when using --rm flag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Helper containers are started with --rm flag which automatically removes the container when it stops. Removed redundant docker rm commands from graceful_shutdown_container in ApplicationDeploymentJob and replaced docker rm with docker stop in DatabaseBackupJob. 🤖 Generated with Claude Code Co-Authored-By: Claude Haiku 4.5 --- app/Jobs/ApplicationDeploymentJob.php | 3 +-- app/Jobs/DatabaseBackupJob.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index cc1a44f9a..8571f8981 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -3176,8 +3176,7 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); try { $timeout = isDev() ? 1 : 30; $this->execute_remote_command( - ["docker stop -t $timeout $containerName", 'hidden' => true, 'ignore_errors' => true], - ["docker rm -f $containerName", 'hidden' => true, 'ignore_errors' => true] + ["docker stop -t $timeout $containerName", 'hidden' => true, 'ignore_errors' => true] ); } catch (Exception $error) { $this->application_deployment_queue->addLogEntry("Error stopping container $containerName: ".$error->getMessage(), 'stderr'); diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.php index a585baa69..d44f014b4 100644 --- a/app/Jobs/DatabaseBackupJob.php +++ b/app/Jobs/DatabaseBackupJob.php @@ -669,7 +669,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueue $this->add_to_error_output($e->getMessage()); throw $e; } finally { - $command = "docker rm -f backup-of-{$this->backup_log_uuid}"; + $command = "docker stop backup-of-{$this->backup_log_uuid}"; instant_remote_process([$command], $this->server, true, false, null, disableMultiplexing: true); } }