From 6d6a3f39afbca991ae2afd9693c003e1a98e7dbc Mon Sep 17 00:00:00 2001 From: Avik Basu Date: Tue, 11 Jun 2024 16:35:13 -0700 Subject: [PATCH] chore: use py3.11 as default base dockerfile Signed-off-by: Avik Basu --- .dockerignore | 3 ++- Dockerfile | 18 ++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.dockerignore b/.dockerignore index a225db57..09c27453 100644 --- a/.dockerignore +++ b/.dockerignore @@ -36,7 +36,8 @@ var/ *.egg-info/ .installed.cfg *.egg +site # Virtual environment .env -venv/ +**/.venv/ diff --git a/Dockerfile b/Dockerfile index 949060b1..b157d144 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ # builder: install needed dependencies and setup virtual environment #################################################################################################### -ARG PYTHON_VERSION=3.12 -FROM python:${PYTHON_VERSION}-slim-bookworm AS builder +ARG PYTHON_VERSION=3.11 +FROM python:${PYTHON_VERSION}-bookworm AS builder -ARG POETRY_VERSION=1.6 +ARG POETRY_VERSION=1.8 ARG INSTALL_EXTRAS ENV POETRY_NO_INTERACTION=1 \ @@ -16,20 +16,14 @@ ENV POETRY_NO_INTERACTION=1 \ POETRY_HOME="/opt/poetry" \ PATH="$POETRY_HOME/bin:$PATH" -RUN apt-get update \ - && apt-get install --no-install-recommends -y build-essential \ - && apt-get clean && rm -rf /var/lib/apt/lists/* \ - && pip install --no-cache-dir poetry==$POETRY_VERSION +RUN pip install --no-cache-dir poetry==$POETRY_VERSION WORKDIR /app COPY poetry.lock pyproject.toml ./ RUN poetry install --without dev --no-root --extras "${INSTALL_EXTRAS}" \ && poetry run pip install --no-cache-dir "torch>=2.0,<3.0" --index-url https://download.pytorch.org/whl/cpu \ - && poetry run pip install --no-cache-dir "lightning[pytorch]" \ - && rm -rf $POETRY_CACHE_DIR \ - && pip cache purge \ - && apt-get purge -y --auto-remove build-essential + && poetry run pip install --no-cache-dir "lightning[pytorch]<3.0" #################################################################################################### # runtime: used for running the udf vertices @@ -37,7 +31,7 @@ RUN poetry install --without dev --no-root --extras "${INSTALL_EXTRAS}" \ FROM python:${PYTHON_VERSION}-slim-bookworm AS runtime RUN apt-get update \ - && apt-get install --no-install-recommends -y dumb-init \ + && apt-get install dumb-init \ && apt-get clean && rm -rf /var/lib/apt/lists/* \ && apt-get purge -y --auto-remove