From 319b739d7921faf5c744f4f6a38157378f327421 Mon Sep 17 00:00:00 2001
From: Emmanuel Bruno <emmanuel.bruno@univ-tln.fr>
Date: Sat, 8 May 2021 16:33:18 +0200
Subject: [PATCH] fixes conda env for jupyter.

---
 Dockerfile                                                 | 6 ++++--
 ...ter_notebook_config.py => jupyter_codeserver_config.py} | 0
 configs/jupyter_config.json                                | 7 +++++++
 run.sh                                                     | 2 +-
 4 files changed, 12 insertions(+), 3 deletions(-)
 rename code-server/{codeserver-jupyter_notebook_config.py => jupyter_codeserver_config.py} (100%)
 create mode 100644 configs/jupyter_config.json

diff --git a/Dockerfile b/Dockerfile
index 69888aa..13eff87 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -75,9 +75,11 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
 		fix-permissions $CONDA_DIR && \
 	    	fix-permissions /home/$NB_USER
 
-COPY code-server/codeserver-jupyter_notebook_config.py /tmp/
+COPY configs/* /home/jovyan/.jupyter/
+COPY code-server/jupyter_codeserver_config.py /tmp/
 COPY code-server/icons $HOME/.jupyter/icons
-RUN cat /tmp/codeserver-jupyter_notebook_config.py >> $HOME/.jupyter/jupyter_notebook_config.py
+RUN [[ ! -f /home/jovyan/.jupyter/jupyter_config.py ]] && touch /home/jovyan/.jupyter/jupyter_config.py ; \
+	cat /tmp/jupyter_codeserver_config.py >> /home/jovyan/.jupyter/jupyter_config.py 
 
 USER $NB_USER
 
diff --git a/code-server/codeserver-jupyter_notebook_config.py b/code-server/jupyter_codeserver_config.py
similarity index 100%
rename from code-server/codeserver-jupyter_notebook_config.py
rename to code-server/jupyter_codeserver_config.py
diff --git a/configs/jupyter_config.json b/configs/jupyter_config.json
new file mode 100644
index 0000000..f6f2b99
--- /dev/null
+++ b/configs/jupyter_config.json
@@ -0,0 +1,7 @@
+{
+  "CondaKernelSpecManager": {
+    "kernelspec_path": "--user",
+    "__env_filter": "/opt/conda/*"
+  }
+}
+
diff --git a/run.sh b/run.sh
index d14ac6c..214d539 100755
--- a/run.sh
+++ b/run.sh
@@ -6,7 +6,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 docker run --rm \
 	--name ${PWD##*/} \
 	--volume $PWD/work:/home/jovyan/work \
-        --publish 8888:8888 \
+        --publish 8889:8888 \
         --env NB_UID=$UID \
 	--env JUPYTER_ENABLE_LAB=yes \
         ${BASE}:$SHA 
-- 
GitLab