-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile
29 lines (23 loc) · 906 Bytes
/
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
FROM registry.access.redhat.com/ubi9/python-311:9.5-1737537151@sha256:fc669a67a0ef9016c3376b2851050580b3519affd5ec645d629fd52d2a8b8e4a as base
COPY --from=ghcr.io/astral-sh/uv:0.5.26@sha256:a0c0e6aed043f5138957ea89744536eed81f1db633dc9bb3be2b882116060be2 /uv /bin/uv
COPY LICENSE /licenses/
ENV \
# use venv from ubi image
UV_PROJECT_ENVIRONMENT=$APP_ROOT \
# disable uv cache. it doesn't make sense in a container
UV_NO_CACHE=true
COPY pyproject.toml uv.lock ./
# Test lock file is up to date
RUN uv lock --locked
# other project related files
COPY README.md Makefile ./
# the source code
COPY qontract_development_cli ./qontract_development_cli
# Install dependencies
RUN uv sync --frozen
FROM base AS test
RUN make test
FROM test AS pypi
# Secrets are owned by root and are not readable by others :(
USER root
RUN --mount=type=secret,id=app-sre-pypi-credentials/token make -s pypi