From e82c8934d66e29fbe91914be398215f9150a2e84 Mon Sep 17 00:00:00 2001 From: alexPatrie Date: Mon, 26 Feb 2024 14:48:13 -0500 Subject: [PATCH] added jupyteruser and cmd in dockerfile with volume example --- Dockerfile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bfde8ca34..548e8a5fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,8 @@ COPY ./poetry.lock /app COPY ./notebooks /app/notebooks +COPY ./data /app/data + RUN apt-get update && apt-get install -y --no-install-recommends \ python3 \ python3-pip \ @@ -48,7 +50,6 @@ RUN pip install --upgrade pip \ RUN poetry config virtualenvs.in-project true RUN poetry run pip install --upgrade pip \ - && poetry add python-libnuml --use-pep517 \ && poetry install # activate poetry virtualenv @@ -61,7 +62,16 @@ ENV STORAGE_LOCAL_CACHE_DIR="/app/scratch" # activate the poetry virtualenv each new non-interative shell RUN echo "source /app/.venv/bin/activate" >> /etc/bash.bashrc -# TODO: ADD VOLUME MOUNT -# VOLUME +# add volume mount for co-simulation data +VOLUME /app/data + +# Using VOLUME allows different sim tools to share inputs and outputs +# For example: docker volume create sim-data +# docker run -v sim-data:/app/data --name simulator1 simulator1-image +# docker run -v sim-data:/app/data --name simulator2 simulator2-image + +RUN useradd -m -s /bin/bash jupyteruser +RUN chown -R jupyteruser:jupyteruser /app +USER jupyteruser -ENTRYPOINT ["poetry", "run", "jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"] +CMD ["poetry", "run", "jupyter", "lab", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]