From 821b917812105f63223ce6dfeb10e5a7ee781145 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Sun, 4 Jan 2026 21:49:29 +0100 Subject: [PATCH 1/3] Switch deploy script from Swarm to Docker Compose Docker Swarm had persistent issues with network allocation on icek, causing tasks to stay stuck in "Preparing" state. Docker Compose works reliably for single-node deployments. Changes: - Use docker compose instead of docker stack - Add --pull flag to force registry pulls (default: prefer local images) - Remove swarm init logic (no longer needed) - Update help text and output messages --- scripts/deploy-swarm.sh | 53 ++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/scripts/deploy-swarm.sh b/scripts/deploy-swarm.sh index 399337a1c..80c8a3b27 100755 --- a/scripts/deploy-swarm.sh +++ b/scripts/deploy-swarm.sh @@ -6,7 +6,7 @@ print_help() { cat </dev/null || echo "unknown") -if [ "$SWARM_STATE" != "active" ]; then - echo "Initializing Docker Swarm (single-node, localhost only)..." - docker swarm init --advertise-addr 127.0.0.1 --listen-addr 127.0.0.1:2377 -fi +COMPOSE_DIR="$SCRIPT_DIR/../docker" echo "Deploying version: $VERSION" echo "Blog env: $BLOG_ENV_FILE" echo "Wallet env: $WALLET_ENV_FILE" -docker pull "registry.gitlab.syncad.com/hive/denser/blog:${VERSION}" -docker pull "registry.gitlab.syncad.com/hive/denser/wallet:${VERSION}" +BLOG_IMAGE="registry.gitlab.syncad.com/hive/denser/blog:${VERSION}" +WALLET_IMAGE="registry.gitlab.syncad.com/hive/denser/wallet:${VERSION}" + +# Check for local images and pull only if needed +pull_if_needed() { + local image="$1" + local name="$2" + + if [ "$FORCE_PULL" = "true" ]; then + echo "Pulling $name (--pull specified)..." + docker pull "$image" + elif docker image inspect "$image" >/dev/null 2>&1; then + echo "Using local $name image" + else + echo "Local $name image not found, pulling from registry..." + docker pull "$image" + fi +} + +pull_if_needed "$BLOG_IMAGE" "blog" +pull_if_needed "$WALLET_IMAGE" "wallet" export VERSION export BLOG_ENV_FILE export WALLET_ENV_FILE -docker stack deploy -c "$COMPOSE_FILE" denser + +cd "$COMPOSE_DIR" +docker compose up -d echo "" -echo "Deployment initiated. Services will update in the background." -echo "Check status with: docker service ls" -echo "Check logs with: docker service logs denser_denser-blog" +echo "Deployment complete." +echo "Check status with: docker ps" +echo "Check logs with: docker logs docker-denser-blog-1" -- GitLab From 1141bc080f77d08593fa467967b875516a1c94e0 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Sun, 4 Jan 2026 22:24:22 +0100 Subject: [PATCH 2/3] Add --wait flag to ensure health checks pass before returning --- scripts/deploy-swarm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/deploy-swarm.sh b/scripts/deploy-swarm.sh index 80c8a3b27..6cf7917e0 100755 --- a/scripts/deploy-swarm.sh +++ b/scripts/deploy-swarm.sh @@ -123,9 +123,9 @@ export BLOG_ENV_FILE export WALLET_ENV_FILE cd "$COMPOSE_DIR" -docker compose up -d +docker compose up -d --wait --wait-timeout 120 echo "" -echo "Deployment complete." +echo "Deployment complete. All services healthy." echo "Check status with: docker ps" echo "Check logs with: docker logs docker-denser-blog-1" -- GitLab From 0de3b90508ada2eef9f76e979497a69835815028 Mon Sep 17 00:00:00 2001 From: Gandalf Date: Sun, 4 Jan 2026 22:47:15 +0100 Subject: [PATCH 3/3] Rename deploy-swarm.sh to deploy.sh (uses Docker Compose, not Swarm) --- scripts/{deploy-swarm.sh => deploy.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{deploy-swarm.sh => deploy.sh} (100%) diff --git a/scripts/deploy-swarm.sh b/scripts/deploy.sh similarity index 100% rename from scripts/deploy-swarm.sh rename to scripts/deploy.sh -- GitLab