File tree Expand file tree Collapse file tree 5 files changed +2309
-28
lines changed
Expand file tree Collapse file tree 5 files changed +2309
-28
lines changed Original file line number Diff line number Diff line change 2323 python-impl :
2424 - python
2525 python-version :
26- - ' 3.10'
2726 - ' 3.11'
2827 - ' 3.12'
2928 steps :
Original file line number Diff line number Diff line change 33ARG PYTHON=3.11
44ARG DEBIAN=bullseye
55
6+ # use this image to copy uv binaries from
7+ FROM ghcr.io/astral-sh/uv:python$PYTHON-bookworm-slim AS uv-bin
8+ RUN uv -V
9+ RUN uvx -V
10+
611# stage-0: copy pyproject.toml/poetry.lock and install the production set of dependencies
7- FROM python:$PYTHON-slim-$DEBIAN as stage-0
12+ FROM python:$PYTHON-slim-$DEBIAN AS stage-0
813ARG PYTHON
914# install runtime first deps to speedup the dev deps and because layers will be reused on stage-1
1015RUN apt-get -qy update
1116RUN apt-get -qy install libssl1.1 graphviz librocksdb6.11
1217# dev deps for this build start here
1318RUN apt-get -qy install libssl-dev libffi-dev build-essential zlib1g-dev libbz2-dev libsnappy-dev liblz4-dev librocksdb-dev cargo git pkg-config
19+ COPY --from=uv-bin /usr/local/bin/uv /usr/local/bin/uvx /bin/
1420# install all deps in a virtualenv so we can just copy it over to the final image
15- RUN pip --no-input --no-cache-dir install --upgrade pip wheel poetry
16- ENV POETRY_VIRTUALENVS_IN_PROJECT=true
1721WORKDIR /app/
18- COPY pyproject.toml poetry .lock ./
19- RUN poetry install -n -E sentry --no-root --only=main
22+ COPY pyproject.toml uv .lock ./
23+ # RUN uv pip install --extra sentry -e .
2024COPY hathor ./hathor
2125COPY README.md ./
22- RUN poetry build -f wheel
23- RUN poetry run pip install dist/hathor-*.whl
26+ RUN uv sync --frozen
27+ RUN uv build --sdist --wheel
28+ RUN uv pip install dist/hathor-*.whl
2429
2530# finally: use production .venv from before
2631# lean and mean: this image should be about ~50MB, would be about ~470MB if using the whole stage-1
You can’t perform that action at this time.
0 commit comments