-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDockerfile
60 lines (51 loc) · 1.54 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
# A Dockerfile for LavaVu
# Using Ubuntu 20.04 we have a new Mesa build that supports LLVMpipe OSMesa
# No longer need to build our own mesa
# Test with:
# https://mybinder.org/v2/gh/lavavu/LavaVu/master?filepath=notebooks
FROM ubuntu:20.04
LABEL maintainer="[email protected]"
LABEL repo="https://github.com/lavavu/LavaVu"
# Install build dependencies
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
python3 \
python3-pip
# Install python packages
RUN pip3 install --no-cache \
packaging \
appdirs \
numpy \
jupyter \
notebook \
matplotlib \
runipy \
pillow \
scipy \
h5py \
RISE \
jupyter-server-proxy \
jupyterlab \
lavavu-osmesa
# Create user with a home directory
ENV USER=jovyan UID=1000
ENV HOME=/home/${USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${UID} \
${USER}
COPY ./notebooks ${HOME}
RUN chown -R jovyan:jovyan ${HOME}
# Copy notebooks to ${HOME}
USER ${USER}
WORKDIR ${HOME}
# delete some unnecessary files,
# trust included notebooks,
# add a notebook profile.
RUN cd ~ && \
find . -name \*.ipynb -print0 | xargs -0 jupyter trust && \
mkdir .jupyter && \
echo "c.ServerApp.ip = '0.0.0.0'" >> .jupyter/jupyter_notebook_config.py && \
echo "c.ServerApp.token = ''" >> .jupyter/jupyter_notebook_config.py
# launch notebook
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--NotebookApp.token=''", "--no-browser"]