diff --git a/Makefile b/Makefile index 96b2da6..aa40a3b 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ up: run run: build docker compose up -build: docker-compose.yaml jupyterlab.Dockerfile +build: docker-compose.yaml jupyter/Dockerfile docker compose build down: diff --git a/docker-compose.yaml b/docker-compose.yaml index 1a0172b..e57e732 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -5,11 +5,22 @@ services: container_name: jupyter build: context: . - dockerfile: jupyterlab.Dockerfile + dockerfile: jupyter/Dockerfile restart: unless-stopped ports: - 0.0.0.0:9001:9001 volumes: - - ./notebooks:/notebooks + - ./jupyter/notebooks:/notebooks + - ./jupyter/overrides.json:/opt/conda/share/jupyter/lab/settings/overrides.json + environment: + - JUPYTER_TOKEN=12345 + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: 1 + capabilities: + - gpu diff --git a/jupyter/Dockerfile b/jupyter/Dockerfile new file mode 100644 index 0000000..de71f15 --- /dev/null +++ b/jupyter/Dockerfile @@ -0,0 +1,34 @@ + +FROM continuumio/miniconda3 + +# docker run -i -t -p 8888:8888 continuumio/miniconda3 /bin/bash \ +# -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir \ +# /opt/notebooks && /opt/conda/bin/jupyter notebook \ +# --notebook-dir=/opt/notebooks --ip='*' --port=8888 \ +# --no-browser --allow-root" + + +RUN conda config --quiet --add channels conda-forge \ + && conda install -c conda-forge --quiet -y jupyterlab + +#RUN conda install -c conda-forge --quiet --freeze-installed -y \ +RUN conda install -c conda-forge --quiet -y \ + pandas \ + librosa \ + matplotlib \ + pyarrow \ + pillow=9.4.0 \ + tensorflow \ + keras \ + && /bin/true # only added to make the installed package lines consistent + +# (NO) libtiff +# pillow + +CMD /opt/conda/bin/jupyter lab \ + --notebook-dir=/notebooks \ + --ip='*' \ + --port=9001 \ + --no-browser \ + --allow-root + diff --git a/jupyter/overrides.json b/jupyter/overrides.json new file mode 100644 index 0000000..3d39e80 --- /dev/null +++ b/jupyter/overrides.json @@ -0,0 +1,5 @@ +{ + "@jupyterlab/apputils-extension:themes": { + "theme": "JupyterLab Dark" + } +} diff --git a/jupyterlab.Dockerfile b/jupyterlab.Dockerfile deleted file mode 100644 index ad63e9a..0000000 --- a/jupyterlab.Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ - -FROM continuumio/miniconda3 - -# docker run -i -t -p 8888:8888 continuumio/miniconda3 /bin/bash \ -# -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir \ -# /opt/notebooks && /opt/conda/bin/jupyter notebook \ -# --notebook-dir=/opt/notebooks --ip='*' --port=8888 \ -# --no-browser --allow-root" - -RUN /opt/conda/bin/conda install jupyterlab -y --quiet \ - && mkdir /opt/notebooks - -CMD /opt/conda/bin/jupyter lab \ - --notebook-dir=/notebooks \ - --ip='*' \ - --port=9001 \ - --no-browser \ - --allow-root -