-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
44 lines (35 loc) · 1.08 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
FROM python:3.7-buster
LABEL maintainer="[email protected]"
RUN mkdir -p /home/project/dash_app
WORKDIR /home/project/dash_app
# requirements for propnet
RUN apt-get update
RUN apt-get install graphviz libgraphviz-dev -y
RUN pip install numpy scipy pygraphviz
ADD requirements.txt /home/project/dash_app/requirements.txt
ADD setup.py /home/project/dash_app/setup.py
RUN pip install --no-cache-dir -r requirements.txt
ADD . /home/project/dash_app
RUN pip install -e .
# set up propnet env vars
ENV PROPNET_NUM_WORKERS=8
ENV PMG_MAPI_KEY='MATERIALS_PROJECT_KEY_HERE'
ENV PROPNET_CORRELATION_STORE_FILE="CORRELATION_STORE_FILE_OR_JSON_STRING"
# requirements for binder
RUN pip install --no-cache-dir notebook==5.*
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${NB_USER}
COPY . ${HOME}
USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_USER}
# start web server
EXPOSE 8000
CMD gunicorn --workers=$PROPNET_NUM_WORKERS --timeout=300 --bind=0.0.0.0 app:server