# Use Python 3.9 image FROM python:3.9-slim # Set working directory WORKDIR /app # Install system dependencies # libsndfile1 is required for soundfile/librosa # ffmpeg is required for pydub # Install system dependencies directly to avoid line-ending issues RUN apt-get update && apt-get install -y \ libsndfile1 \ ffmpeg \ build-essential \ python3-dev \ && rm -rf /var/lib/apt/lists/* # Copy backend requirements # Copy backend requirements COPY backend/requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Copy the application code COPY . . # Create data directory just in case RUN mkdir -p "data sets" # Expose the port Hugging Face expects (7860) EXPOSE 7860 # Run the Uvicorn server # Using backend.main:app as per run_app.ps1 # Binding to 0.0.0.0 and port 7860 CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"]