ai-music-detection / deploy.sh
juzer09's picture
Upload 19 files
f280f9f verified
raw
history blame
1.37 kB
#!/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\"]}'"