Skip to content

Commit

Permalink
added jupyteruser and cmd in dockerfile with volume example
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Feb 26, 2024
1 parent 5f55d5c commit e82c893
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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"]

0 comments on commit e82c893

Please sign in to comment.