From dc1904ea1e46302105fc66aeb04f52b95dd1345c Mon Sep 17 00:00:00 2001 From: Cam Parry Date: Mon, 11 Dec 2023 02:33:21 -1000 Subject: [PATCH] use wheels --- Dockerfile | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index aa7964fca..da7bb7223 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,14 +18,9 @@ RUN apt-get update && \ # Copy the current directory contents into the container at /app COPY requirements.txt . -# Make a virtualenv that we can copy across multistage builds -ENV VIRTUAL_ENV=/venv -RUN python -m venv $VIRTUAL_ENV -# "Activate" the virtualenv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - # Install any needed packages specified in requirements.txt -RUN pip install --no-cache-dir -r /app/requirements.txt +RUN pip install wheel && \ + pip wheel --no-cache-dir --wheel-dir=/app/wheels -r requirements.txt ############################################################################### FROM $LITELLM_RUNTIME_IMAGE as runtime @@ -35,11 +30,9 @@ WORKDIR /app # Copy the current directory contents into the container at /app COPY . . -# "Activate" the virtualenv -ENV VIRTUAL_ENV=/venv -ENV PATH="$VIRTUAL_ENV/bin:$PATH" +COPY --from=builder /app/wheels /app/wheels -COPY --from=builder /venv /venv +RUN pip install --no-index --find-links=/app/wheels -r requirements.txt EXPOSE 4000/tcp