-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·69 lines (60 loc) · 1.87 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·69 lines (60 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
# Deployment script for Mac Studio with Docker + Cloudflare Tunnel
set -e
echo "🚀 ICD Prediction Website - Docker Deployment"
echo "=============================================="
# Step 1: Build frontend with Docker environment
echo ""
echo "📦 Step 1: Building frontend..."
cp .env.docker .env
npm install
npm run build
echo "✅ Frontend built to ./dist/"
# Step 2: Build and start Docker containers
echo ""
echo "🐳 Step 2: Building Docker images..."
docker-compose build --no-cache
echo ""
echo "🚀 Step 3: Starting containers..."
docker-compose up -d
# Step 4: Wait for services to be healthy
echo ""
echo "⏳ Step 4: Waiting for services to be healthy..."
sleep 5
# Check if containers are running
if docker-compose ps | grep -q "Up"; then
echo "✅ Containers are running"
docker-compose ps
else
echo "❌ Error: Containers failed to start"
docker-compose logs
exit 1
fi
# Step 5: Test the deployment
echo ""
echo "🧪 Step 5: Testing deployment..."
if curl -f http://127.0.0.1:8080/health > /dev/null 2>&1; then
echo "✅ Health check passed"
else
echo "⚠️ Warning: Health check failed (services may still be starting up)"
fi
echo ""
echo "=============================================="
echo "✨ Deployment complete!"
echo ""
echo "Services:"
echo " • Backend: http://127.0.0.1:8080/api/"
echo " • Frontend: http://127.0.0.1:8080/"
echo " • Health: http://127.0.0.1:8080/health"
echo ""
echo "Next steps:"
echo " 1. Test locally: open http://127.0.0.1:8080"
echo " 2. Configure cloudflared tunnel to point to 127.0.0.1:8080"
echo " 3. Monitor logs: docker-compose logs -f"
echo ""
echo "Commands:"
echo " • Stop: docker-compose down"
echo " • Restart: docker-compose restart"
echo " • Logs: docker-compose logs -f [service]"
echo " • Update: ./deploy.sh"
echo "=============================================="