Spaces:
Sleeping
Sleeping
File size: 1,309 Bytes
14ffa0f | 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 | #!/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 |