# Use official Python base FROM python:3.9-slim # Add this near the top of your Dockerfile # Prevent prompts during package installation ENV DEBIAN_FRONTEND=noninteractive # Fix Numba caching issue ENV NUMBA_CACHE_DIR=/tmp # Install essential system packages for audio and ML RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ curl \ git \ fluidsynth \ ffmpeg \ libsndfile1 \ libaubio-dev \ libavcodec-dev \ libavformat-dev \ libavutil-dev \ libsamplerate0-dev \ libjack-dev \ libasound2-dev \ libportaudio2 \ portaudio19-dev \ rubberband-cli \ sox \ && rm -rf /var/lib/apt/lists/* # Set work directory WORKDIR /app # Copy requirements file first to leverage Docker cache COPY requirements.txt . # Install tensorflow-cpu explicitly (needed for crepe) RUN pip3 install --no-cache-dir tensorflow-cpu==2.10.0 # Install the rest of the Python dependencies from requirements.txt RUN pip3 install --no-cache-dir -r requirements.txt # Verify Numba configuration RUN python -c "import numba; print(f'Numba version: {numba.__version__}'); print(f'Numba cache config: {numba.config.CACHE_DIR}')" # Copy your actual codebase COPY . . EXPOSE 7860 # Default command to run the FastAPI application using Uvicorn CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]