FROM pytorch/pytorch:2.1.2-cuda12.1-cudnn8-runtime # Prevent tzdata / apt from asking interactive questions ARG DEBIAN_FRONTEND=noninteractive ENV TZ=Asia/Kolkata WORKDIR /app # Install system dependencies for audio RUN apt-get update && apt-get install -y \ libsndfile1 \ ffmpeg \ git \ && rm -rf /var/lib/apt/lists/* # Install Python deps COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create cache dir for Transformers RUN mkdir -p /app/cache ENV HF_HOME=/app/cache # Make sure app directory is fully accessible (for cache, temp files, etc.) RUN chmod -R 777 /app # Expose port EXPOSE 7860 # Run FastAPI app with uvicorn CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]