From bc071ee36e3eca21ab450eb2e2bbc6a3d9eea713 Mon Sep 17 00:00:00 2001 From: James Ketrenos Date: Mon, 14 Jul 2025 12:16:51 -0700 Subject: [PATCH] Add pip venv generation on first run --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0dbb6b3..2aef5a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -204,6 +204,7 @@ RUN pip install anthropic pydantic_ai # Automatic type conversion pydantic -> typescript RUN pip install pydantic typing-inspect jinja2 + RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y \ nodejs \ @@ -220,6 +221,10 @@ RUN { \ echo 'set -e'; \ echo 'echo "Setting pip environment to /opt/backstory"'; \ echo 'if [[ -e /opt/intel/oneapi/setvars.sh ]]; then source /opt/intel/oneapi/setvars.sh; fi' ; \ + echo 'if [[ ! -d /opt/backstory/venv/bin ]]; then'; \ + echo ' python3 -m venv --system-site-packages /opt/backstory/venv'; \ + echo ' pip install -r /opt/backstory/requirements.txt'; \ + echo 'fi'; \ echo 'source /opt/backstory/venv/bin/activate'; \ echo ''; \ echo 'if [[ "${1}" == "/bin/bash" ]] || [[ "${1}" =~ ^(/opt/backstory/)?shell$ ]]; then'; \ @@ -260,6 +265,8 @@ ENV SYCL_PI_LEVEL_ZERO_USE_IMMEDIATE_COMMANDLISTS=1 ENV SYCL_CACHE_PERSISTENT=1 ENV PATH=/opt/backstory:$PATH +RUN pip freeze > /opt/backstory/requirements.txt + ENTRYPOINT [ "/entrypoint.sh" ] FROM backstory AS backstory-prod