-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile.cuda
More file actions
44 lines (31 loc) · 1.08 KB
/
Dockerfile.cuda
File metadata and controls
44 lines (31 loc) · 1.08 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
41
42
43
44
FROM nvidia/cuda:12.9.2-cudnn-devel-ubuntu24.04 AS build
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
git \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install --no-cache-dir torch torchvision torchaudio \
--index-url https://download.pytorch.org/whl/cu128 \
&& pip install --no-cache-dir -r requirements.txt
FROM nvidia/cuda:12.9.2-cudnn-runtime-ubuntu24.04 AS runtime
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
libgomp1 \
libgl1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=build /app/venv /app/venv
COPY . .
ENV PATH="/app/venv/bin:$PATH"
ENV PYTHONUNBUFFERED=1
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
# Use the venv python directly — avoids PATH resolution ambiguity
ENTRYPOINT ["/app/venv/bin/python3", "engine/main.py"]