Skip to content
This repository was archived by the owner on Mar 10, 2021. It is now read-only.

Commit a1d30e5

Browse files
committed
lock from to image version and use tmp to copy/install packages
Signed-off-by: Greg Werner <[email protected]>
1 parent bfe3faa commit a1d30e5

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
1-
FROM jupyter/minimal-notebook:latest
1+
FROM jupyter/minimal-notebook:45bfe5a474fa
2+
3+
ARG PGWEB_VERSION=0.11.6
24

35
USER root
46
RUN apt-get update \
7+
&& apt-get upgrade -y \
58
&& apt-get install -y \
69
curl \
710
unzip \
8-
wget
11+
wget \
12+
&& apt-get clean \
13+
&& rm -rf /var/lib/apt/lists/*
914

1015
# install pgweb
11-
ENV PGWEB_VERSION=0.11.6
16+
ENV PGWEB_VERSION="${PGWEB_VERSION}"
1217
RUN wget -q "https://github.com/sosedoff/pgweb/releases/download/v${PGWEB_VERSION}/pgweb_linux_amd64.zip" \
1318
&& unzip pgweb_linux_amd64.zip -d /usr/bin \
1419
&& mv /usr/bin/pgweb_linux_amd64 /usr/bin/pgweb
1520

1621
# setup package, enable classic extension, build lab extension
1722
USER "${NB_USER}"
18-
COPY . "${HOME}"/
19-
COPY requirements.txt "${HOME}"/
20-
WORKDIR "${HOME}"
23+
RUN mkdir -p "/${HOME}/jupyter-pgweb-proxy"
24+
COPY . "/${HOME}/jupyter-pgweb-proxy"
25+
WORKDIR "/${HOME}/jupyter-pgweb-proxy"
2126
RUN python3 -m pip install .
2227
RUN python3 -m pip install -r requirements.txt \
2328
&& jupyter serverextension enable --sys-prefix jupyter_server_proxy \
@@ -29,3 +34,5 @@ USER root
2934
RUN fix-permissions /etc/jupyter
3035

3136
USER "${NB_USER}"
37+
38+
WORKDIR "${HOME}"

jupyter_notebook_config.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
"headers": {"Content-Security-Policy": "frame-ancestors 'self' *"},
1111
"cookie_options": {"SameSite": "None", "Secure": True},
1212
}
13+
14+
# allows running the notebook as root
1315
c.NotebookApp.allow_root = True
16+
17+
# accepts any origin by default, change to add restrictions
1418
c.NotebookApp.allow_origin = '*'
19+
20+
# add a token if you would like to run this notebook on a public network
1521
c.NotebookApp.token = ''
22+
23+
# forward to jupyterlab by default
1624
c.NotebookApp.default_url = '/lab'

0 commit comments

Comments
 (0)