Browse Source

Pull Docker image before stopping container in dw update

Minimizes downtime by downloading the new image while the app
is still running, then stopping and restarting with the new version.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tuanchris 9 months ago
parent
commit
8e00a5d0d6
1 changed files with 3 additions and 3 deletions
  1. 3 3
      dw

+ 3 - 3
dw

@@ -144,12 +144,12 @@ cmd_update() {
     fi
     fi
 
 
     if is_docker_mode; then
     if is_docker_mode; then
-        echo "Stopping current container..."
-        sudo docker compose down
-
         echo "Pulling latest Docker image..."
         echo "Pulling latest Docker image..."
         sudo docker compose pull
         sudo docker compose pull
 
 
+        echo "Stopping current container..."
+        sudo docker compose down
+
         echo "Starting with new version..."
         echo "Starting with new version..."
         sudo docker compose up -d --remove-orphans
         sudo docker compose up -d --remove-orphans