Spaces:
Sleeping
Sleeping
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\"]}'" |