-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
49 lines (37 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
49 lines (37 loc) · 1.17 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
45
46
47
48
49
# syntax=docker/dockerfile:1.7
FROM python:3.12-slim AS runtime
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
UV_LINK_MODE=copy \
EXPERIMENT_SCRIPT=inference_human_lymph_node.sh \
HYDRA_FULL_ERROR=1 \
TQDM_DISABLE=1
ARG APP_UID=1007
ARG APP_GID=1007
RUN printf 'BUILD-TIME:\n' \
' APP_UID=%s\n' \
' APP_GID=%s\n' \
' CUDA_VISIBLE_DEVICES=%s\n' \
' EXPERIMENT_SCRIPT=%s\n' \
"${APP_UID}" \
"${APP_GID}" \
"${CUDA_VISIBLE_DEVICES:-<unset>}" \
"${EXPERIMENT_SCRIPT}"
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
ca-certificates \
gcc \
python3-dev \
time \
&& rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | \
UV_INSTALL_DIR=/usr/local/bin sh
RUN groupadd --gid ${APP_GID} app \
&& useradd --uid ${APP_UID} --gid app --create-home app
WORKDIR /home/app
COPY spin ./spin
RUN uv pip install --no-cache --system ./spin
RUN chown -R app:app /home/app
USER app
CMD ["bash", "-c", "cd spin-experiments && $EXPERIMENT_SCRIPT"]