# Base image with CUDA 12.8, cuDNN 9, PyTorch 2.7.0 FROM pytorch/pytorch:2.7.0-cuda12.8-cudnn9-devel # Set working directory WORKDIR /usr/src/app # Install system dependencies, then clean up RUN apt-get update && \ apt-get install -y --no-install-recommends git wget && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Copy application files COPY . . # Install Python dependencies RUN pip install --upgrade pip && \ pip install --no-cache-dir -r requirements.txt && \ MAX_JOBS=4 pip install flash-attn --use-pep517 --no-build-isolation # Make script executable and move it to PATH RUN install -m 755 sft.py /usr/local/bin/sft # Set environment variables ENV XDG_CACHE_HOME=/usr/src/app/cache # Expose the Gradio port EXPOSE 7860 ENV GRADIO_SERVER_NAME="0.0.0.0" # Start the application CMD ["python", "app.py"]