FROM pytorch/pytorch:2.8.0-cuda12.8-cudnn9-runtime # has python3.11 # Install system dependencies RUN apt-get update && apt-get install -y \ ffmpeg \ libsndfile1 \ g++ \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Copy requirements and install COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install Flash Attention 2 using pre-built wheels (requires torch to be installed first) RUN pip install packaging #RUN pip install flash-attn --no-build-isolation --no-cache-dir RUN pip install https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.8cxx11abiTRUE-cp311-cp311-linux_x86_64.whl # Copy application code COPY main.py . # Expose port 8080 EXPOSE 8080 ENV PYTHONUNBUFFERED=1 # Start uvicorn CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080", "--log-level", "debug"]