-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
75 lines (58 loc) · 2.4 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
# set tag forjupyter/minimal-notebook
ARG IMG_VERISON=e6970b22a504
##############
# BUILDSTAGE #
##############
FROM jupyter/minimal-notebook:${IMG_VERISON} AS build_stage
COPY --chown=1000:100 build_requirements_conda.txt /tmp
RUN conda config --add channels conda-forge && \
conda install -yq --file /tmp/build_requirements_conda.txt && \
conda clean -afy && \
rm -rf /tmp/*
COPY --chown=1000:100 jupyterlab-expose /tmp/jupyterlab-expose
RUN cd /tmp/jupyterlab-expose && \
python setup.py bdist_wheel
############
# RUNSTAGE #
############
FROM jupyter/minimal-notebook:${IMG_VERISON}
LABEL maintainer="FASTGenomics <[email protected]>"
# overwrite conda default channels
COPY --chown=1000:100 config /tmp/config
RUN (echo; cat /tmp/config/.condarc) >> /opt/conda/.condarc && \
rm -rf /tmp/*
# Install conda requirements
COPY --chown=1000:100 requirements_conda.txt /tmp
RUN conda config --add channels conda-forge && \
conda install -yq --file /tmp/requirements_conda.txt && \
conda clean -afy && \
rm -rf /tmp/*
# install the jupyter expose extensions
COPY --from=build_stage /tmp/jupyterlab-expose/dist/jupyterlab_expose-2.0.0-py3-none-any.whl /opt/
RUN pip install /opt/jupyterlab_expose-2.0.0-py3-none-any.whl
# install jupyterfg (including the save hook)
COPY --chown=1000:100 jupyterfg /tmp/jupyterfg
RUN cd /tmp/jupyterfg && \
flit install && \
rm -rf /tmp/*
# install crash extension
COPY --chown=1000:100 crash_ext /tmp/crash_ext
RUN cd /tmp/crash_ext && \
flit install && \
rm -rf /tmp/*
# append the save hook to the original config file.
# AND copy overrides.json to settings folder to enable save widget state as default
COPY --chown=1000:100 config /tmp/config
RUN (echo; cat /tmp/config/jupyter_server_config.py) >> /etc/jupyter/jupyter_server_config.py && \
mkdir -pv /opt/conda/share/jupyter/lab/settings && \
cp /tmp/config/overrides.json /opt/conda/share/jupyter/lab/settings/overrides.json && \
rm -rf /tmp/*
USER root
RUN mkdir /fastgenomics && \
chown -v -R 1000:100 /fastgenomics && \
chown -v -R 1000:100 /home/jovyan/.jupyter
USER jovyan
# import default workspace (only for local testing)
COPY --chown=1000:100 workspace.json /home/jovyan/.jupyter/lab/workspaces/
RUN jupyter lab workspaces import /home/jovyan/.jupyter/lab/workspaces/workspace.json
WORKDIR /fastgenomics