-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
44 lines (37 loc) · 1.11 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
##############
# base stage #
##############
FROM registry.access.redhat.com/ubi9/python-312@sha256:116fc1952f0647e4f1f0d81b4f8dfcf4e8fcde735f095314a7532c7dc64bdf7f AS base
COPY LICENSE /licenses/LICENSE
#################
# builder stage #
#################
FROM base AS builder
COPY --from=ghcr.io/astral-sh/uv:0.5.5@sha256:dc60491f42c9c7228fe2463f551af49a619ebcc9cbd10a470ced7ada63aa25d4 /uv /bin/uv
ENV \
# use venv from ubi image
UV_PROJECT_ENVIRONMENT="/opt/app-root" \
# compile bytecode for faster startup
UV_COMPILE_BYTECODE="true" \
# 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
# Install the project dependencies
RUN uv sync --frozen --no-install-project --no-group dev
COPY README.md ./
COPY validator ./validator
RUN uv sync --frozen --no-group dev
##############
# test stage #
##############
FROM builder AS test
COPY Makefile ./
RUN uv sync --frozen
RUN make _test
##############
# prod stage #
##############
FROM base AS prod
COPY --from=builder /opt/app-root /opt/app-root