-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
70 lines (50 loc) · 1.69 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
# ubuntu 16.04, https://github.com/phusion/baseimage-docker
FROM phusion/baseimage
MAINTAINER eromoe|mithril
ARG PYTHON_VERSION="3.6"
ARG DARK_THEME=0
SHELL ["/bin/bash", "-c"]
# China Customize
COPY update_source.sh /tmp/update_source.sh
RUN bash /tmp/update_source.sh
RUN echo \
&& echo '[global]' >> /etc/pip.conf \
&& echo 'index-url = https://mirrors.aliyun.com/pypi/simple' >> /etc/pip.conf \
&& echo "registry = https://registry.npm.taobao.org" >> /etc/npmrc
# Set the locale
RUN locale-gen "en_US.UTF-8"
RUN dpkg-reconfigure locales
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV PYTHONIOENCODING utf-8
ENV PIP_INDEX_URL "https://mirrors.aliyun.com/pypi/simple"
# Allow `docker logs` show python app logs
ENV PYTHONUNBUFFERED 0
# Install build tools & lib dependencies
RUN apt-get update && \
apt-get install -y build-essential libcurl4-openssl-dev libxml2-dev libxslt1-dev libpq-dev
# install python
RUN apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update
RUN apt-get install -y python${PYTHON_VERSION}-dev wget git vim curl
# set python 3.5 as default
RUN ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python
# because download is very slow in some place, so bundle get-pip.py
COPY get-pip.py /tmp/get-pip.py
RUN python /tmp/get-pip.py
RUN pip install -U pip setuptools
# Enable python notebooks
RUN pip install \
ipython \
jupyter \
jupyterthemes
# Set up notebook config
RUN mkdir -p /root/.jupyter/
COPY jupyter_notebook_config.py /root/.jupyter/
# Set notebook dark theme
# jt -t chesterish -T -N
COPY run_jupyter.sh /run_jupyter.sh
ENTRYPOINT ["/bin/bash"]
# CMD ["/run_jupyter.sh"]