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