fix(swarm): Remove build directives and unsupported options for swarm
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

Docker Swarm doesn't support build directives or security_opt.
Images must be pre-built before deployment.

Changes:
- Created build-images.sh script to build all images
- Updated deploy-swarm.sh to check for images and offer to build
- Removed build: sections from docker-compose.swarm.yml
- Removed security_opt: (not supported in swarm)
- Services now reference pre-built images only

Deployment workflow:
1. ./build-images.sh (build all images)
2. ./deploy-swarm.sh mosaic (deploy to swarm)
This commit is contained in:
2026-02-08 01:31:29 -06:00
parent 2a9a1f1367
commit 7f3499b1f2
3 changed files with 74 additions and 25 deletions

View File

@@ -72,10 +72,33 @@ else
echo "✅ traefik-public network already exists"
fi
# Build images (optional - uncomment if you want to build before deploying)
# echo ""
# echo "🔨 Building images..."
# docker compose -f $COMPOSE_FILE build
# Check if images exist, offer to build if not
echo ""
echo "🔍 Checking if images are built..."
IMAGES_MISSING=0
for img in mosaic-stack-postgres mosaic-stack-openbao mosaic-stack-api mosaic-stack-orchestrator mosaic-stack-web; do
if ! docker images --format "{{.Repository}}" | grep -q "^${img}$"; then
echo " ⚠️ Missing: $img"
IMAGES_MISSING=1
fi
done
if [ $IMAGES_MISSING -eq 1 ]; then
echo ""
echo "❌ Some images are missing. Build them first:"
echo " ./build-images.sh"
echo ""
read -p "Build images now? [Y/n]: " BUILD_NOW
BUILD_NOW=${BUILD_NOW:-Y}
if [[ $BUILD_NOW =~ ^[Yy]$ ]]; then
./build-images.sh || exit 1
else
echo "Aborting deployment. Build images first."
exit 1
fi
else
echo "✅ All images are built"
fi
# Deploy the stack
echo ""