FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ libsndfile1 \ ffmpeg \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install CPU-only version of PyTorch to reduce size COPY requirements.txt . RUN pip install --no-cache-dir librosa piano_transcription_inference gradio>=3.50.2 huggingface_hub \ && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu # Copy application code COPY . . # Expose the port Gradio will run on EXPOSE 7860 # Set Gradio to bind to all interfaces in Docker ENV GRADIO_SERVER_NAME="0.0.0.0" # Command to run the application CMD ["python", "app.py"]