-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (22 loc) · 883 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
30
31
32
33
### Use an appropriate version of Python
FROM python:3.13-slim-bullseye@sha256:4cbe85156e6744a7a9dbe637be16a69b961da47c931b6ee11c1f74eab51476ae AS python
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -qq update -y && \
apt-get -qq install -y git >/dev/null
### Install requirements
FROM python AS requirements
COPY requirements.txt /opt/project/
WORKDIR /opt/project
RUN --mount=type=cache,target=/root/.cache \
pip install --disable-pip-version-check --requirement requirements.txt
### Install source and its dependencies
FROM requirements AS source
COPY pyproject.toml /opt/project/
COPY src /opt/project/src
### Define verify command
FROM source AS verify
ENV CI=1
RUN --mount=type=cache,target=/root/.cache \
pip install --quiet --disable-pip-version-check --editable .[style,types,test]
COPY bin/verify* /opt/project/bin/
CMD ["/opt/project/bin/verify"]