From 0b10cbea9dd4f449786afac42f73c24bb57d8130 Mon Sep 17 00:00:00 2001
From: Moritz Maxeiner <mm@ucw.sh>
Date: Wed, 16 Sep 2020 16:53:10 +0200
Subject: [PATCH] [jupyterhub] Move files out of /root

---
 jupyterhub/base/Dockerfile                 | 15 ++++++++-------
 jupyterhub/base/jupyter_notebook_config.py |  4 ++--
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/jupyterhub/base/Dockerfile b/jupyterhub/base/Dockerfile
index 9946bfd..bd65e65 100755
--- a/jupyterhub/base/Dockerfile
+++ b/jupyterhub/base/Dockerfile
@@ -41,9 +41,9 @@ RUN python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install \
     python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install jupyterlab-git && \
     python${JUPYTERHUB_PYTHON_VERSION} -m jupyter lab build
 
-RUN mkdir -p ~/.venv && \
-    python${JUPYTERHUB_PYTHON_VERSION} -m venv ~/.venv/robofish && \
-    . ~/.venv/robofish/bin/activate && \
+RUN mkdir -p /usr/local/venv && \
+    python${JUPYTERHUB_PYTHON_VERSION} -m venv /usr/local/venv/default && \
+    . /usr/local/venv/default/bin/activate && \
     python${JUPYTERHUB_PYTHON_VERSION} -m pip --no-cache-dir install --upgrade pip==20.2.2 && \
     pip --no-cache-dir install --upgrade setuptools==49.1.0 && \
     pip install tensorflow==1.15.3 && \
@@ -70,11 +70,12 @@ RUN mkdir -p ~/.venv && \
         sklearn \
         'mxnet-cu101>=1.6.0,<1.7.0' \
         && \
-    ipython kernel install --user --name=robofish
+    ipython kernel install --user --name=default
 
-COPY jupyter_notebook_config.py /root/.jupyter/
-ENV JUPYTERLAB_SETTINGS_DIR=/data/home/.config/jupyter/lab/user-settings
-ENV JUPYTERLAB_WORKSPACES_DIR=/data/home/.config/jupyter/lab/workspaces
+COPY jupyter_notebook_config.py /etc/jupyter/
+ENV JUPYTER_CONFIG_DIR=/etc/jupyter
+ENV JUPYTERLAB_SETTINGS_DIR=/root/.config/jupyter/lab/user-settings
+ENV JUPYTERLAB_WORKSPACES_DIR=/root/.config/jupyter/lab/workspaces
 
 RUN chmod -x /etc/update-motd.d/*
 RUN mkdir /data
diff --git a/jupyterhub/base/jupyter_notebook_config.py b/jupyterhub/base/jupyter_notebook_config.py
index c80131f..3a2a847 100755
--- a/jupyterhub/base/jupyter_notebook_config.py
+++ b/jupyterhub/base/jupyter_notebook_config.py
@@ -1,4 +1,4 @@
 c.NotebookApp.allow_root = True
 c.NotebookApp.terminado_settings = {"shell_command": ["/bin/bash", "-l"]}
-c.MultiKernelManager.default_kernel_name = "robofish"
-c.NotebookApp.notebook_dir = "/data"
+c.MultiKernelManager.default_kernel_name = "default"
+c.NotebookApp.notebook_dir = "/root"
-- 
GitLab