|
1 |
| -FROM ubuntu:14.04 |
| 1 | +FROM ubuntu:16.04 |
2 | 2 |
|
3 |
| -RUN apt-get update && apt-get -y install build-essential libssl-dev libffi-dev python-dev python-numpy python-scipy python-matplotlib python-pandas python-pip |
4 |
| -RUN pip install -U pip jupyter |
| 3 | +RUN apt-get update && apt-get -y install \ |
| 4 | + python3 \ |
| 5 | + python3-dev \ |
| 6 | + python3-setuptools \ |
| 7 | + python3-pip \ |
| 8 | + build-essential \ |
| 9 | + libssl-dev \ |
| 10 | + libffi-dev \ |
| 11 | + python3-numpy \ |
| 12 | + python3-scipy \ |
| 13 | + python3-matplotlib \ |
| 14 | + python3-pandas |
| 15 | + |
| 16 | +RUN pip3 install -U pip jupyter |
5 | 17 |
|
6 | 18 | # install all dependencies for OpenGrid
|
7 | 19 | ADD requirements.txt /usr/local/opengrid/requirements.txt
|
8 |
| -RUN pip install -r /usr/local/opengrid/requirements.txt |
| 20 | +RUN pip3 install -r /usr/local/opengrid/requirements.txt |
| 21 | + |
| 22 | +# special treatment for charts required for python3 |
| 23 | +COPY charts-0.4.6-python3.tar.gz /usr/local/opengrid/charts-0.4.6-python3.tar.gz |
| 24 | +RUN pip3 install -U /usr/local/opengrid/charts-0.4.6-python3.tar.gz |
9 | 25 |
|
10 | 26 | # create volumes: one for the source code and work dir, one for the data
|
11 | 27 | VOLUME /usr/local/opengrid
|
12 | 28 | VOLUME /data
|
13 | 29 |
|
14 |
| -ENV PYTHONPATH=/usr/local/opengrid:$PYTHONPATH |
| 30 | +# add anonymous data files for electricity, gas and water |
| 31 | +ADD data/electricity*.pickle /data/ |
| 32 | +ADD data/gas*.pickle /data/ |
| 33 | +ADD data/water*.pickle /data/ |
15 | 34 |
|
16 | 35 | # add information for uploading a distribution to pypi. No passwords!
|
17 | 36 | ADD .pypirc /root/.pypirc
|
18 | 37 |
|
| 38 | +ENV PYTHONPATH=/usr/local/opengrid:$PYTHONPATH |
19 | 39 | WORKDIR /usr/local/opengrid
|
20 |
| -CMD ipython notebook --ip='*' |
| 40 | + |
| 41 | +# Add Tini. Tini operates as a process subreaper for jupyter. This prevents |
| 42 | +# kernel crashes. |
| 43 | +ENV TINI_VERSION v0.6.0 |
| 44 | +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini |
| 45 | +RUN chmod +x /usr/bin/tini |
| 46 | +ENTRYPOINT ["/usr/bin/tini", "--"] |
| 47 | + |
| 48 | +EXPOSE 8888 |
| 49 | +CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--NotebookApp.token=''"] |
| 50 | + |
0 commit comments