Skip to content

Commit

Permalink
update to jupyterlab 4
Browse files Browse the repository at this point in the history
  • Loading branch information
matuskosut committed Feb 28, 2024
1 parent 34485e8 commit c554d0b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
30 changes: 17 additions & 13 deletions setup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
FROM jupyter/minimal-notebook:lab-3.6.1
FROM jupyter/minimal-notebook:lab-4.0.7

# USER root
# RUN set -x \
# && apt-get update \
# && apt-get install -y curl vim less
USER root

RUN set -x \
&& apt-get update \
&& apt-get install -y curl vim less

# setup package, enable classic extension, build lab extension
# USER "${NB_USER}"
# RUN mamba install -q -c conda-forge -y gunicorn
RUN fix-permissions /opt/conda
USER "${NB_USER}"

RUN set -x \
&& mamba install -q -c conda-forge -y jupyter-server-proxy \
&& fix-permissions /opt/conda

WORKDIR "${HOME}/jupyter-brat-proxy"
COPY . .
RUN python3 -m pip install "${HOME}/jupyter-brat-proxy"
RUN fix-permissions /opt/conda
RUN set -x \
&& python3 -m pip install "${HOME}/jupyter-brat-proxy" \
&& fix-permissions /opt/conda

WORKDIR "${HOME}"
RUN jupyter serverextension enable --sys-prefix jupyter_server_proxy
RUN jupyter server extension enable --sys-prefix jupyter_server_proxy
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements"

# copy configs, update permissions as root
USER root
RUN rm -rf "${HOME}/jupyter-brat-proxy"
RUN cp /etc/jupyter/jupyter_notebook_config.py /etc/jupyter/jupyter_notebook_config_base.py
COPY setup/jupyter_notebook_config.py /etc/jupyter/jupyter_notebook_config.py
RUN cp /etc/jupyter/jupyter_server_config.py /etc/jupyter/jupyter_server_config_base.py
COPY setup/jupyter_server_config.py /etc/jupyter/jupyter_server_config.py
RUN fix-permissions /etc/jupyter

USER "${NB_USER}"
Expand Down
14 changes: 0 additions & 14 deletions setup/jupyter_notebook_config.py

This file was deleted.

15 changes: 15 additions & 0 deletions setup/jupyter_server_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
c = get_config() # noqa

# load base config
load_subconfig("/etc/jupyter/jupyter_server_config_base.py") # noqa

# supports iframe and samesite cookies
c.ServerApp.tornado_settings = {
"headers": {"Content-Security-Policy": "frame-ancestors 'self' *"},
"cookie_options": {"SameSite": "None", "Secure": True},
}
c.ServerApp.allow_root = True
c.ServerApp.allow_origin = "*"

c.IdentityProvider.token = ""
# c.ServerApp.default_url = "/lab"

0 comments on commit c554d0b

Please sign in to comment.