1- FROM ubuntu:24 .04 AS build
1+ FROM nvidia/cuda:12.9.2-cudnn-devel-ubuntu24 .04 AS build
22
33ARG 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
1212WORKDIR /app
1313
1414RUN python3 -m venv /app/venv
1515ENV 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)
2119RUN 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
3225ARG DEBIAN_FRONTEND=noninteractive
3326
3427RUN 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
3933WORKDIR /app
4034
@@ -43,5 +37,8 @@ COPY . .
4337
4438ENV PATH="/app/venv/bin:$PATH"
4539ENV 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