File size: 1,368 Bytes
f280f9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash

# Madverse Music Deployment Script

set -e

echo "🎡 Deploying Madverse Music API..."

# Check if Docker is installed
if ! command -v docker &> /dev/null; then
    echo "❌ Docker is not installed. Please install Docker first."
    exit 1
fi

# Check if docker-compose is installed
if ! command -v docker-compose &> /dev/null; then
    echo "❌ Docker Compose is not installed. Please install Docker Compose first."
    exit 1
fi

# Set environment variables
export MADVERSE_API_KEY=${MADVERSE_API_KEY:-madverse-music-api-key-2024}

echo "πŸ”§ Building Docker image..."
docker-compose build

echo "πŸš€ Starting services..."
docker-compose up -d

echo "⏳ Waiting for services to be healthy..."
sleep 30

# Test the API
echo "πŸ§ͺ Testing API health..."
if curl -f http://localhost:8000/health > /dev/null 2>&1; then
    echo "βœ… API is healthy and running!"
    echo "πŸ“ API URL: http://localhost:8000"
    echo "πŸ“– API Docs: http://localhost:8000/"
    echo "πŸ”‘ API Key: $MADVERSE_API_KEY"
else
    echo "❌ API health check failed. Check logs:"
    docker-compose logs madverse-api
    exit 1
fi

echo ""
echo "🎯 Quick Test:"
echo "curl -X POST 'http://localhost:8000/analyze' \\"
echo "  -H 'X-API-Key: $MADVERSE_API_KEY' \\"
echo "  -H 'Content-Type: application/json' \\"
echo "  -d '{\"urls\": [\"https://example.com/song.mp3\"]}'"