Template
Update to container and compose service to create a landing page for the jupyterlab interface
This commit is contained in:
+10
-2
@@ -10,11 +10,20 @@ ENV ENV_NAME=idear_env
|
||||
WORKDIR /idear
|
||||
|
||||
#RUN apt-get update && apt-get install -y cifs-utils
|
||||
# Install Graphviz system binaries
|
||||
RUN apt-get update && apt-get install -y \
|
||||
graphviz \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Add this after WORKDIR /idear and before the conda install
|
||||
RUN conda config --remove channels defaults && \
|
||||
conda config --add channels conda-forge && \
|
||||
conda config --set channel_priority strict
|
||||
|
||||
# Use mamba if available for faster installation
|
||||
RUN conda install -y -n base -c conda-forge mamba && \
|
||||
mamba create -y -n $ENV_NAME -c conda-forge python=3.11 \
|
||||
jupyter numpy h5py pandas matplotlib plotly=5.24 scipy pip && \
|
||||
jupyter jupyterlab numpy h5py pandas matplotlib plotly=5.24 scipy pip && \
|
||||
conda clean --all -y && rm -rf /root/.cache/pip
|
||||
|
||||
# Activate the environment and install additional pip packages
|
||||
@@ -40,7 +49,6 @@ RUN conda run -n $ENV_NAME pip install -r /idear/requirements.txt
|
||||
|
||||
# Add JupyterLab
|
||||
RUN pip install graphviz
|
||||
RUN pip install --no-cache-dir jupyterlab
|
||||
|
||||
# If you want to set JupyterLab as the default command
|
||||
#CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root", "--NotebookApp.token='my-token'"]
|
||||
|
||||
+24
-11
@@ -1,19 +1,17 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
idear_processor_networked:
|
||||
image: idear_processor
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- DOCKER_CONTAINER=1
|
||||
- NETWORK_MOUNT=/mnt/network_mount
|
||||
ports:
|
||||
- "${JUPYTER_PORT:-8889}:8888"
|
||||
volumes:
|
||||
- ./data:/idear/data
|
||||
- ./figures:/idear/figures
|
||||
- ./notebooks:/idear/notebooks
|
||||
- ./scripts:/idear/scripts
|
||||
- ./:/idear
|
||||
#- ./data:/idear/data
|
||||
#- ./figures:/idear/figures
|
||||
#- ./notebooks:/idear/notebooks
|
||||
#- ./scripts:/idear/scripts
|
||||
- network_mount:/mnt/network_mount:rw
|
||||
command: >
|
||||
bash -c "
|
||||
@@ -27,15 +25,30 @@ services:
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- DOCKER_CONTAINER=1
|
||||
- NETWORK_MOUNT=/idear/data
|
||||
- JUPYTER_TOKEN=my-token
|
||||
ports:
|
||||
- "${JUPYTER_PORT:-8889}:8888"
|
||||
volumes:
|
||||
- ./:/idear
|
||||
command: >
|
||||
bash -c "
|
||||
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='${JUPYTER_TOKEN:-my-token}'
|
||||
"
|
||||
bash -c '
|
||||
if [ -f WELCOME.ipynb ]; then
|
||||
DEFAULT_URL="/lab/workspaces/default?tree=WELCOME.ipynb"
|
||||
echo "✅ WELCOME.ipynb found - setting as landing page"
|
||||
jupyter trust WELCOME.ipynb
|
||||
else
|
||||
DEFAULT_URL=""
|
||||
echo "⚠️ WELCOME.ipynb not found - using default homepage"
|
||||
fi &&
|
||||
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root \
|
||||
--NotebookApp.token="${JUPYTER_TOKEN:-my-token}" --LabApp.default_url="$DEFAULT_URL" \
|
||||
--ExtensionApp.default_url="$DEFAULT_URL"
|
||||
'
|
||||
|
||||
#command: >
|
||||
# bash -c "
|
||||
# jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='${JUPYTER_TOKEN:-my-token}'
|
||||
# "
|
||||
profiles:
|
||||
- local-only
|
||||
|
||||
|
||||
Reference in New Issue
Block a user