Spaces:
Sleeping
Sleeping
| # 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 |