FROM nvidia/cuda:12.1.0-cudnn8-runtime-ubuntu22.04 ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ apt-get install -y --no-install-recommends python3 python3-pip curl && \ ln -sf python3 /usr/bin/python && \ rm -rf /var/lib/apt/lists/* WORKDIR /app RUN pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cu121 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY train_hf.py . EXPOSE 7860 CMD ["python", "train_hf.py"]