forked from DiamondLightSource/SuRVoS2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
81 lines (69 loc) · 2.25 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM nvidia/cuda:11.7.1-devel-ubuntu20.04
WORKDIR /app
COPY . .
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt-get update -y && apt-get install -y dialog apt-utils && \
apt-get install -y \
build-essential \
wget \
git \
mesa-utils \
libgl1-mesa-glx \
libglib2.0-0 \
libfontconfig1 \
libxrender1 \
libdbus-1-3 \
libxkbcommon-x11-0 \
libxi6 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
&& apt-get clean
# Install miniconda
ENV PATH="/usr/local/miniconda3/bin:${PATH}"
ARG PATH="/usr/local/miniconda3/bin:${PATH}"
RUN wget \
https://repo.anaconda.com/miniconda/Miniconda3-py38_22.11.1-1-Linux-x86_64.sh -O Miniconda3.sh \
&& bash Miniconda3.sh -b -p /usr/local/miniconda3 \
&& rm -f Miniconda3.sh
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"]
RUN pip install --no-cache-dir -r requirements.txt
RUN python ./survos2/improc/setup.py build_ext --inplace
RUN mkdir survos2_workbench && sed -i 's|/tmp|/app/survos2_workbench|g' settings.yaml && pip install -e .
ENTRYPOINT ["napari"]
RUN apt-get install -y wget gnupg2 apt-transport-https && \
wget -O - https://xpra.org/gpg.asc | apt-key add - && \
echo "deb https://xpra.org/ focal main" > /etc/apt/sources.list.d/xpra.list
RUN apt-get update -y && \
apt-get install -y \
xpra \
xvfb \
xterm \
sshfs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV DISPLAY=:100
ENV XPRA_PORT=9876
ENV XPRA_START="python3 -m napari"
ENV XPRA_EXIT_WITH_CLIENT="yes"
ENV XPRA_XVFB_SCREEN="1920x1080x24+32"
EXPOSE 9876
CMD echo "Launching napari on Xpra. Connect via http://localhost:$XPRA_PORT"; \
xpra start \
--bind-tcp=0.0.0.0:$XPRA_PORT \
--html=on \
--start="$XPRA_START" \
--exit-with-client="$XPRA_EXIT_WITH_CLIENT" \
--daemon=no \
--xvfb="/usr/bin/Xvfb +extension Composite -screen 0 $XPRA_XVFB_SCREEN -nolisten tcp -noreset" \
--pulseaudio=no \
--notifications=no \
--bell=no \
$DISPLAY
ENTRYPOINT []