Skip to content

Commit bb51d1f

Browse files
authored
build: adjust dockerfile (#104)
Fixes #93
1 parent 35fd370 commit bb51d1f

1 file changed

Lines changed: 12 additions & 7 deletions

File tree

Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
1-
# syntax=docker/dockerfile:1
1+
# SPDX-FileCopyrightText: 2024 Heinz-Alexander Fütterer
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
# syntax=docker/dockerfile:1.7
26

37
# base
48
# ----------------------------
5-
FROM python:3.12-slim as base
9+
FROM python:3.12.3-slim@sha256:fd3817f3a855f6c2ada16ac9468e5ee93e361005bd226fd5a5ee1a504e038c84 as base
610

711
ENV PYTHONDONTWRITEBYTECODE=1 \
812
PYTHONUNBUFFERED=1 \
913
PIP_DISABLE_PIP_VERSION_CHECK=1 \
1014
PIP_NO_CACHE_DIR=1 \
15+
PIP_ONLY_BINARY=:all: \
1116
PIP_ROOT_USER_ACTION=ignore
1217

1318
# build stage
1419
# ----------------------------
1520
FROM base as build
1621

22+
ENV BUILD_VERSION=1.2.1
23+
1724
WORKDIR /app
1825

19-
RUN python -m pip install build
26+
RUN python -m pip install --quiet build[uv]=="$BUILD_VERSION"
2027

2128
COPY pyproject.toml .
2229
COPY README.md .
2330
COPY src ./src
2431

25-
RUN python -m build --wheel
32+
RUN python -m build --installer=uv --wheel
2633

2734
# runtime stage
2835
# ----------------------------
@@ -32,11 +39,9 @@ ARG VERSION
3239

3340
RUN adduser --group --system --no-create-home re3data
3441

35-
WORKDIR /app
36-
3742
COPY --from=build /app/dist ./dist
3843

39-
RUN python -m pip install "./dist/python_re3data-$VERSION-py3-none-any.whl[cli]"
44+
RUN python -m pip install --quiet "./dist/python_re3data-$VERSION-py3-none-any.whl[cli]" && rm -rf ./dist
4045

4146
USER re3data
4247

0 commit comments

Comments
 (0)