generated from DiamondLightSource/bookshelf-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (33 loc) · 1.17 KB
/
Dockerfile
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
50
51
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION} as base
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
ocl-icd-libopencl1
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
FROM python:${PYTHON_VERSION}-slim as base-slim
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
ocl-icd-libopencl1
RUN mkdir -p /etc/OpenCL/vendors && \
echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
FROM base as interactive
ENV WORKDIR=/environment
WORKDIR ${WORKDIR}
COPY . ${WORKDIR}
RUN pip install --upgrade .[interactive]
EXPOSE 8888
CMD ["jupyter-lab", "--ip=0.0.0.0", "--allow-root"]
FROM base-slim as processing
ENV WORKDIR=/environment
WORKDIR ${WORKDIR}
COPY . ${WORKDIR}
RUN pip install --upgrade .[processing]
VOLUME /inputs /outputs
ENTRYPOINT ["papermill", "notebook.ipynb", "/outputs/notebook.ipynb", "--parameters", "OUTPUT_PREFIX", "/outputs", "--parameters", "INPUT_PREFIX", "/inputs"]