forked from salve-/seismo_live
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (29 loc) · 1.52 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
# Fork from a jupyter provided template. Its a scientific stack with a conda
# environment. Defaults to Python 3 but also has Python 2. For now we'll only
# install libs on Python 3.
FROM jupyter/scipy-notebook
MAINTAINER Lion Krischer <[email protected]>
# Install system libs as root.
USER root
RUN apt-get update
RUN apt-get install -y gfortran git
# Rest as jovyan user who is provided by the Jupyter notebook template.
USER jovyan
# Install ObsPy and Instaseis Dependencies.
RUN conda install --yes -c obspy obspy h5py future requests tornado flake8 pytest mock basemap pip jupyter jsonschema
RUN pip install responses
# Install Instaseis from git.
RUN cd /tmp; git clone https://github.com/krischer/instaseis.git; cd instaseis; pip install -v -e .
# Copy the actual notebooks.
COPY notebooks/ /home/jovyan/work/
# A bit ugly but unfortunately necessary: https://github.com/docker/docker/issues/6119
USER root
RUN chown -R jovyan:users /home/jovyan/work
USER jovyan
# Download the instaseis database.
RUN mkdir -p /home/jovyan/work/Instaseis/data/database
RUN wget -qO- "http://www.geophysik.uni-muenchen.de/~krischer/instaseis/20s_PREM_ANI_FORCES.tar.gz" | tar xvz -C /home/jovyan/work/Instaseis/data/database
# Set a default backend for matplotlib!
RUN mkdir -p ~/.config/matplotlib && touch ~/.config/matplotlib/matplotlibrc && printf "\nbackend: agg\n" >> ~/.config/matplotlib/matplotlibrc
# Build the font cache so its already done in the notebooks.
RUN python -c "from matplotlib.font_manager import FontManager; FontManager()"