-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.gpu
More file actions
39 lines (29 loc) · 1.36 KB
/
Dockerfile.gpu
File metadata and controls
39 lines (29 loc) · 1.36 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
# ── Build stage ──────────────────────────────────────────────────────
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 AS builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential python3.11 python3.11-venv python3.11-dev python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN python3.11 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY pyproject.toml README.md ./
COPY grdl_rt/ ./grdl_rt/
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir ".[gpu]"
# ── Runtime stage ────────────────────────────────────────────────────
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04 AS runtime
RUN apt-get update && \
apt-get install -y --no-install-recommends python3.11 && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" \
PYTHONUNBUFFERED=1 \
NVIDIA_VISIBLE_DEVICES=all \
NVIDIA_DRIVER_CAPABILITIES=compute,utility
# Non-root user
RUN useradd --create-home grdl
USER grdl
WORKDIR /home/grdl
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD test -f /tmp/grdl_rt_healthy
ENTRYPOINT ["grdl-rt"]