-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
48 lines (35 loc) · 1.38 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
FROM continuumio/miniconda3
EXPOSE 8893/tcp
ENV CODE_DIR=/opt/code
ENV CM_CONDA_ENV_NAME="ccc"
ENV CM_N_JOBS=1
ENV CM_ROOT_DIR=/opt/data
ENV CM_USER_HOME=${CM_ROOT_DIR}/user_home
ENV CM_MANUSCRIPT_DIR=/opt/manuscript
VOLUME ${CM_ROOT_DIR}
VOLUME ${CM_MANUSCRIPT_DIR}
# install gnu parallel
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y --no-install-recommends parallel \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# setup phenoplier
COPY environment/environment.yml environment/scripts/install_other_packages.sh environment/scripts/install_r_packages.r /tmp/
RUN conda env create --name ${CM_CONDA_ENV_NAME} --file /tmp/environment.yml \
&& conda run -n ${CM_CONDA_ENV_NAME} --no-capture-output /bin/bash /tmp/install_other_packages.sh \
&& conda clean --all --yes
# activate the environment when starting bash
RUN echo "conda activate ${CM_CONDA_ENV_NAME}" >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]
ENV PYTHONPATH=${CODE_DIR}/libs:${PYTHONPATH}
RUN echo "Make sure packages can be loaded"
RUN python -c "import papermill"
COPY . ${CODE_DIR}
WORKDIR ${CODE_DIR}
RUN echo "Make sure modules can be loaded"
RUN python -c "from ccc import conf"
# setup user home directory
RUN mkdir ${CM_USER_HOME} && chmod -R 0777 ${CM_USER_HOME}
ENV HOME=${CM_USER_HOME}
ENTRYPOINT ["/opt/code/entrypoint.sh"]
CMD ["scripts/run_nbs_server.sh", "--container-mode"]