Luis-Filipe's picture
Upload 7 files
14ffa0f verified
#!/bin/bash
# Real DJ Mixxx System - Docker Startup Script
# Professional DJ Software for Hugging Face Spaces
set -e
echo "🎧 Starting Real DJ Mixxx System - Docker Edition..."
# Check if Python is available
if ! command -v python3 &> /dev/null; then
echo "❌ Python3 not found. Installing..."
apk add --no-cache python3 py3-pip
fi
# Check if Node.js is available
if ! command -v node &> /dev/null; then
echo "❌ Node.js not found. Installing..."
apk add --no-cache nodejs npm
fi
# Install Python dependencies if requirements.txt exists
if [ -f "requirements.txt" ]; then
echo "πŸ“¦ Installing Python dependencies..."
pip3 install --no-cache-dir -r requirements.txt
fi
# Install Node.js dependencies if package.json exists
if [ -f "package.json" ]; then
echo "πŸ“¦ Installing Node.js dependencies..."
npm install --production
fi
# Check if server.py exists
if [ -f "server.py" ]; then
echo "πŸš€ Starting FastAPI server..."
exec python3 server.py
elif [ -f "index.html" ]; then
echo "🌐 Starting static file server..."
if command -v npx &> /dev/null; then
exec npx serve . -p 7860
else
exec python3 -m http.server 7860
fi
else
echo "❌ No application found. Please ensure server.py or index.html exists."
exit 1
fi