Skip to content

Commit

Permalink
chore: use py3.11 as default base dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: Avik Basu <[email protected]>
  • Loading branch information
ab93 committed Jun 11, 2024
1 parent 1239acd commit 6d6a3f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ var/
*.egg-info/
.installed.cfg
*.egg
site

# Virtual environment
.env
venv/
**/.venv/
18 changes: 6 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -16,28 +16,22 @@ 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
####################################################################################################
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

Expand Down

0 comments on commit 6d6a3f3

Please sign in to comment.