Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use py3.11 as default base dockerfile #391

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading