-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 1.13 KB
/
Copy pathDockerfile
File metadata and controls
40 lines (30 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
FROM nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
ENV DEBIAN_FRONTEND=noninteractive \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
curl \
git \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y --no-install-recommends \
python3.12 \
python3.12-dev \
python3.12-venv \
&& rm -rf /var/lib/apt/lists/*
# uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
# Install dependencies first (better layer caching — only reruns when lock file changes)
COPY pyproject.toml uv.lock .python-version ./
RUN uv sync --no-dev --no-install-project --extra-index-url https://download.pytorch.org/whl/cu121
# Copy source after deps so code changes don't invalidate the dep layer
COPY src/ src/
COPY configs/ configs/
# Make the src package importable without building a wheel
ENV PYTHONPATH=/app/src
# HuggingFace cache mount point
VOLUME ["/root/.cache/huggingface"]
# Output mount point
VOLUME ["/app/output"]
CMD ["uv", "run", "sft-train", "configs/prod.yaml"]