Skip to content

Commit 2f16cfa

Browse files
authored
Update Dockerfile to use NVIDIA CUDA base images
1 parent 1f74aab commit 2f16cfa

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

Dockerfile.cuda

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:24.04 AS build
1+
FROM nvidia/cuda:12.9.2-cudnn-devel-ubuntu24.04 AS build
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

@@ -7,34 +7,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
77
python3-pip \
88
python3-venv \
99
git \
10-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
10+
&& rm -rf /var/lib/apt/lists/*
1111

1212
WORKDIR /app
1313

1414
RUN python3 -m venv /app/venv
1515
ENV PATH="/app/venv/bin:$PATH"
1616

17-
# Upgrade pip to reduce dependency resolution issues
18-
RUN pip install --upgrade --no-cache-dir pip setuptools wheel
17+
COPY requirements.txt .
1918

20-
# Install PyTorch first (largest package)
2119
RUN pip install --no-cache-dir torch torchvision torchaudio \
22-
--index-url https://download.pytorch.org/whl/cu128
20+
--index-url https://download.pytorch.org/whl/cu128 \
21+
&& pip install --no-cache-dir -r requirements.txt
2322

24-
# Copy requirements and install
25-
COPY requirements.txt backend/requirements.txt ./
26-
RUN pip install --no-cache-dir -r backend/requirements.txt && \
27-
pip install --no-cache-dir -r requirements.txt && \
28-
rm -rf ~/.cache/pip/* /tmp/*
29-
30-
FROM ubuntu:24.04 AS runtime
23+
FROM nvidia/cuda:12.9.2-cudnn-runtime-ubuntu24.04 AS runtime
3124

3225
ARG DEBIAN_FRONTEND=noninteractive
3326

3427
RUN apt-get update && apt-get install -y --no-install-recommends \
3528
python3 \
3629
libgomp1 \
37-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
30+
libgl1 \
31+
&& rm -rf /var/lib/apt/lists/*
3832

3933
WORKDIR /app
4034

@@ -43,5 +37,8 @@ COPY . .
4337

4438
ENV PATH="/app/venv/bin:$PATH"
4539
ENV PYTHONUNBUFFERED=1
40+
ENV NVIDIA_VISIBLE_DEVICES=all
41+
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
4642

47-
ENTRYPOINT ["python3", "engine/main.py"]
43+
# Use the venv python directly — avoids PATH resolution ambiguity
44+
ENTRYPOINT ["/app/venv/bin/python3", "engine/main.py"]

0 commit comments

Comments
 (0)