-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
executable file
·62 lines (52 loc) · 1.61 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
# Base Python Image
FROM python:3.8
# Install dependencies
RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
wget \
curl \
bzip2 \
git \
sudo \
make \
cmake \
libatlas-base-dev \
libboost-dev \
libboost-system-dev \
libboost-filesystem-dev \
gcc \
g++ \
unzip \
vim \
tmux \
xsel \
cmake --fix-missing \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt requirements.txt
RUN pip install -U pip && pip install -r requirements.txt
# for jupyter
# USER jovyan
RUN jupyter contrib nbextension install --user
# Set up Jupyter Notebook config
ENV CONFIG_NOTEBOOK /root/.jupyter/jupyter_notebook_config.py
ENV CONFIG_IPYTHON /root/.ipython/profile_default/ipython_config.py
RUN jupyter notebook --generate-config --allow-root && \
ipython profile create
RUN echo "c.NotebookApp.ip = '0.0.0.0'" >>${CONFIG_NOTEBOOK} && \
echo "c.NotebookApp.port = 8888" >>${CONFIG_NOTEBOOK} && \
echo "c.NotebookApp.allow_root = True" >>${CONFIG_NOTEBOOK} && \
echo "c.NotebookApp.open_browser = False" >>${CONFIG_NOTEBOOK} && \
echo "c.MultiKernelManager.default_kernel_name = 'python3'" >>${CONFIG_NOTEBOOK}
# vim key bind
# Create required directory in case (optional)
RUN mkdir -p $(jupyter --data-dir)/nbextensions && \
cd $(jupyter --data-dir)/nbextensions && \
rm -rf vim_binding/ && \
git clone https://github.com/lambdalisue/jupyter-vim-binding vim_binding && \
jupyter nbextension enable vim_binding/vim_binding
# jupyter notebook theme
RUN jt -vim -T -N -t monokai
# 8888:jupyter
EXPOSE 8888