-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (32 loc) · 1.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# SPDX-FileCopyrightText: 2024 Heinz-Alexander Fütterer
#
# SPDX-License-Identifier: MIT
# syntax=docker/dockerfile:1.7
# base
# ----------------------------
FROM python:3.13.0-slim@sha256:751d8bece269ba9e672b3f2226050e7e6fb3f3da3408b5dcb5d415a054fcb061 AS base
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
PIP_ONLY_BINARY=:all: \
PIP_ROOT_USER_ACTION=ignore
# build stage
# ----------------------------
FROM base AS build
ENV BUILD_VERSION=1.2.1
WORKDIR /app
RUN python -m pip install --quiet build[uv]=="$BUILD_VERSION"
COPY pyproject.toml .
COPY README.md .
COPY src ./src
RUN python -m build --installer=uv --wheel
# runtime stage
# ----------------------------
FROM base AS runtime
ARG VERSION
RUN adduser --group --system --no-create-home re3data
COPY --from=build /app/dist ./dist
RUN python -m pip install --quiet "./dist/python_re3data-$VERSION-py3-none-any.whl[cli]" && rm -rf ./dist
USER re3data
ENTRYPOINT ["re3data"]