FROM python:3.10 WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ libffi-dev \ libsndfile1 \ libasound2 \ libxt6 \ && rm -rf /var/lib/apt/lists/* # Copy requirements first to leverage Docker cache COPY requirements.txt . # Install PyTorch CPU first (2.6.0 available for CPU) RUN pip install --no-cache-dir torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 # Install the rest of requirements RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY . . EXPOSE 7860 ENV PYTHONUNBUFFERED=1 # Run the application CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]