#!/bin/bash # Deployment script for Lottery Simple DApp set -e echo "🚀 Building and deploying Lottery Simple DApp..." # Build the Docker image echo "📦 Building Docker image..." docker-compose build # Stop existing container if running echo "🛑 Stopping existing container..." docker-compose down # Start the new container echo "▶️ Starting new container..." docker-compose up -d # Wait a moment for startup sleep 3 # Check if it's running if curl -s http://localhost:14888/health > /dev/null; then echo "✅ Deployment successful!" echo "🌐 Frontend available at: http://localhost:14888" echo "🏥 Health check: http://localhost:14888/health" else echo "❌ Deployment failed - health check failed" echo "📋 Container logs:" docker-compose logs exit 1 fi echo "🎉 Deployment complete!"