rabin 7 lat temu
rodzic
commit
327f89f643

+ 17 - 3
src/docker/build/tool/jupyter/Dockerfile

@@ -16,10 +16,24 @@ RUN apk update && apk add --no-cache gcc g++ curl make libzmq python-dev python3
 	pip3 install pyzmq --install-option="--zmq=/usr/local/zeromq" && \
 	pip3 install -U ipykernel && \
 	python3 -m ipykernel install --user && \
-	mkdir /usr/local/jupyter && \
-	pip3 install jupyterlab && \
+	python2 -m ipykernel install --user && \
+	pip2 install jupyterlab && \
+	pip2 install jupyter_contrib_nbextensions && \
+	pip2 install jupyter_nbextensions_configurator && \
+	pip2 install jupyter_dashboards && \
+	pip2 install rise && \
+	jupyter contrib nbextension install --user && \
+	jupyter nbextensions_configurator enable --user && \
+	jupyter dashboards quick-setup --sys-prefix && \
+	jupyter-nbextension install rise --py --sys-prefix && \
+	jupyter-nbextension enable rise --py --sys-prefix && \
+
 	pip3 install incremental && \
 	pip3 install scrapy && \
-	apk del curl gcc g++ make python-dev python3-dev
+	pip3 install gevent && \
+	apk del openssl-dev && apk add postgresql-dev && pip3 install psycopg2 && \
+	pip3 install pymysql && \
+
+	apk del curl gcc g++ make
 
 COPY jupyter.sh /entrypoint/jupyter.sh

+ 9 - 1
src/docker/build/tool/jupyter/jupyter.sh

@@ -3,7 +3,15 @@ set -e
 
 start_jupyter()
 {
-	jupyter notebook --allow-root --no-browser --notebook-dir=/usr/local/jupyter --port=8888 --ip=*
+	jupyter notebook --allow-root --no-browser --notebook-dir=/src --port=8888 --ip=0.0.0.0 &
+	if [ "$1" == "lab" ]; then
+        start_jupyterlab
+    fi
+}
+
+start_jupyterlab()
+{
+	jupyter lab --allow-root --no-browser --notebook-dir=/src --port=8889 --ip=0.0.0.0 &
 }
 
 stop_jupyter()

+ 3 - 3
src/docker/conf/py.conf

@@ -16,6 +16,6 @@ alias = python3
 
 [note]
 image = jupyter
-port = 10001:8888
-volumes = {container}conf/jupyter:/root/.jupyter
-command = jupyter
+port = 10001:8888,10002:8889
+#volumes = {container}conf/jupyter:/root/.jupyter,{container}src/jupyter:/src
+command = jupyter lab