Skip to content

Commit 6962b70

Browse files
author
Susan Vanderplas
committed
Fix python and caching
1 parent e03219e commit 6962b70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,23 @@ ENV VENV_PATH=/opt/venv
5858
RUN python3 -m venv $VENV_PATH
5959

6060
# Make sure pip is up to date and install common build tools
61+
ENV PATH="$VENV_PATH/bin:$PATH"
6162
RUN $VENV_PATH/bin/pip install --upgrade pip setuptools wheel
6263

6364
# Register venv globally for R/reticulate and Quarto
64-
ENV PATH="$VENV_PATH/bin:$PATH"
6565
ENV RETICULATE_PYTHON=$VENV_PATH/bin/python
6666
ENV QUARTO_PYTHON=$VENV_PATH/bin/python
6767

68-
# Pre-install Jupyter kernel so Quarto sees it, and populate with dependencies
69-
RUN $VENV_PATH/bin/pip install ipykernel && \
70-
$VENV_PATH/bin/python -m ipykernel install --prefix=/usr/local --name=venv --display-name "Python (venv)" \
71-
$VENV_PATH/bin/pip install -r /project/requirements.txt
72-
68+
# If your file lives at project root:
69+
COPY requirements.txt /tmp/requirements.txt
70+
# Tools in the venv
71+
RUN $VENV_PATH/bin/pip install --upgrade pip setuptools wheel ipykernel && \
72+
$VENV_PATH/bin/python -m ipykernel install --prefix=/usr/local --name=venv --display-name "Python (venv)" && \
73+
$VENV_PATH/bin/pip install -r /tmp/requirements.txt
7374

7475
# Ensure cache dirs exist
7576
RUN mkdir -p ${RENV_PATHS_CACHE} ${PIP_CACHE_DIR} /root/.virtualenvs
7677

77-
7878
WORKDIR /project
7979

8080
# Default command: render and publish

0 commit comments

Comments
 (0)