-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
126 lines (101 loc) · 4.28 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
FROM aiidateam/aiida-core:1.4.2
LABEL maintainer="Materials Cloud Team <aiidalab@materialscloud.org>"
# Configure environment.
ENV AIIDALAB_HOME /home/${SYSTEM_USER}
ENV AIIDALAB_APPS ${AIIDALAB_HOME}/apps
ENV AIIDALAB_DEFAULT_GIT_BRANCH master
USER root
# Install OS dependencies.
RUN apt-get update && apt-get install -y \
ca-certificates \
cp2k \
file \
libssl-dev \
libffi-dev \
povray \
python3-pip \
python3-setuptools \
python3-wheel \
quantum-espresso \
&& rm -rf /var/lib/apt/lists/*
# Install what is needed for Jupyter Lab.
RUN apt-get update && apt-get install -y \
nodejs \
npm \
&& rm -rf /var/lib/apt/lists/*
# Install Jupyter-related things in the root environment.
RUN /usr/bin/pip3 install \
'jupyterhub==1.1.0' \
'jupyterlab==2.2.8' \
'notebook==6.1.4'
# Install ngrok to be able to proxy AiiDA RESTful API server.
RUN wget --quiet -P /tmp/ \
https://bin.equinox.io/a/dnxFaDKQgP4/ngrok-2.3.35-linux-amd64.zip \
&& unzip /tmp/ngrok-2.3.35-linux-amd64.zip \
&& mv ./ngrok /usr/local/bin/ \
&& rm -f /tmp/ngrok-2.3.35-linux-amd64.zip
# Install jupyterlab theme (takes about 4 minutes and 10 seconds).
#WORKDIR /opt/jupyterlab-theme
#RUN git clone https://github.com/aiidalab/jupyterlab-theme && \
# cd jupyterlab-theme && \
# npm install && \
# npm run build && \
# npm run build:webpack && \
# npm pack ./ && \
# /usr/local/bin/jupyter labextension install *.tgz && \
# cd ..
# Change workdir.
WORKDIR /opt/
# Install Python packages needed for AiiDAlab and populate reentry cache for root (https://pypi.python.org/pypi/reentry/).
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN reentry scan
# Install python kernel from the conda environment (comes with the aiidalab package).
RUN python -m ipykernel install
# Install and enable nbserverproxy.
RUN /usr/bin/pip3 install nbserverproxy==0.8.8
RUN /usr/local/bin/jupyter serverextension enable --py --sys-prefix nbserverproxy
# Install and enable nglview.
RUN /usr/bin/pip3 install nglview==2.7.7
RUN /usr/local/bin/jupyter nbextension enable nglview --py --sys-prefix
# Install and enable appmode.
RUN git clone https://github.com/oschuett/appmode.git && cd appmode && git reset --hard v0.8.0
COPY gears.svg ./appmode/appmode/static/gears.svg
RUN /usr/bin/pip3 install ./appmode
RUN /usr/local/bin/jupyter nbextension enable --py --sys-prefix appmode
RUN /usr/local/bin/jupyter serverextension enable --py --sys-prefix appmode
# Install and enable bqplot.
RUN /usr/bin/pip3 install bqplot
RUN /usr/local/bin/jupyter nbextension install --py --symlink --sys-prefix bqplot
RUN /usr/local/bin/jupyter nbextension enable bqplot --py --sys-prefix
# Install voila package and AiiDAlab voila template.
RUN /usr/bin/pip3 install voila==0.2.4
RUN /usr/bin/pip3 install voila-aiidalab-template==0.2.1
# Enable widget_periodictable (installed with aiidalab package).
RUN /usr/bin/pip3 install widget-periodictable==2.1.5
RUN /usr/local/bin/jupyter nbextension install --py --user widget_periodictable
RUN /usr/local/bin/jupyter nbextension enable widget_periodictable --user --py
# Install OPTIMADE.
WORKDIR /opt/
RUN git clone https://github.com/aiidalab/aiidalab-optimade.git && cd aiidalab-optimade && git reset --hard v1.2.1
RUN pip install -e ./aiidalab-optimade
# Install some useful packages that are not available on PyPi
RUN conda install --yes -c conda-forge \
openbabel==3.1.1 \
rdkit==2020.09.1 \
&& conda clean --all
# Prepare user's folders for AiiDAlab launch.
COPY opt/aiidalab-singleuser /opt/
COPY opt/prepare-aiidalab.sh /opt/
COPY my_init.d/prepare-aiidalab.sh /etc/my_init.d/80_prepare-aiidalab.sh
# Get aiidalab-home app.
RUN git clone https://github.com/aiidalab/aiidalab-home && cd aiidalab-home && git reset --hard v20.11.0
RUN chmod 774 aiidalab-home
# Copy scripts to start Jupyter notebook.
COPY opt/start-notebook.sh /opt/
COPY service/jupyter-notebook /etc/service/jupyter-notebook/run
# Expose port 8888.
EXPOSE 8888
# Remove when the following issue is fixed: https://github.com/jupyterhub/dockerspawner/issues/319.
COPY my_my_init /sbin/my_my_init
CMD ["/sbin/my_my_init"]