-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
69 lines (55 loc) · 1.95 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
FROM python:3.8-buster
# Base packages
RUN apt-get update&& \
apt-get -y install graphviz build-essential python-dev ffmpeg fish
RUN pip install --upgrade pip
# Install jupyter notebook
RUN pip3 install jupyter jupyterlab
# Install viz dependencies
RUN pip3 install matplotlib ipyvolume seaborn
# Lock to datajoint 0.12.9
RUN pip3 install datajoint==0.12.9
# Install the outside packages
WORKDIR /src
COPY README.md /microns-nda-access/.
COPY Dockerfile /microns-nda-access/.
COPY docker-compose.yml /microns-nda-access/.
RUN git clone --depth 1 --branch v8 https://github.com/cajal/microns_phase3_nda
RUN pip3 install torch==1.9.0+cpu torchvision==0.10.0+cpu torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html
RUN pip3 install -e microns_phase3_nda/
RUN pip3 install git+https://github.com/AllenInstitute/em_coregistration.git@phase3
# Set up work environment
WORKDIR /notebooks
COPY README.md .
RUN mkdir tutorial_notebooks/ && cp -r /src/microns_phase3_nda/tutorial_notebooks/. tutorial_notebooks/.
RUN mkdir workspace/
# Start jupyter notebook
RUN mkdir -p /scripts \
&& mkdir -p /root/.jupyter/custom/
# The configuration files are placed here to avoid more file dependencies. Quite messy, but should work the same.
RUN echo "#!/usr/bin/env bash \n\
\n\
jupyter lab "$@" --allow-root\n" \
>> /scripts/run_jupyter.sh
RUN echo "# Accept all incoming requests \n\
c.NotebookApp.ip = '0.0.0.0' \n\
c.NotebookApp.port = 8888 \n\
c.NotebookApp.open_browser = False \n\
c.MultiKernelManager.default_kernel_name = 'python3' \n\
c.NotebookApp.token = '' \n\
c.NotebookApp.password = ''\n" \
>> /root/.jupyter/jupyter_notebook_config.py
RUN echo ".container { \n\
width: 75% !important; \n\
} \n\
\n\
div.cell.selected { \n\
border-left-width: 1px !important; \n\
} \n\
\n\
div.output_scroll { \n\
resize: vertical !important; \n\
}\n" \
>> /root/.jupyter/custom/custom.css
RUN chmod -R a+x /scripts
ENTRYPOINT ["/scripts/run_jupyter.sh"]