-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
46 lines (34 loc) · 933 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
34
35
36
37
38
39
40
41
42
43
44
45
46
ARG PYTHON_VERSION="3.10"
ARG ROOT_CONTAINER=python:${PYTHON_VERSION}-slim-bullseye
FROM ${ROOT_CONTAINER} AS binaries
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
USER root
WORKDIR /tmp
ENV DEBIAN_FRONTEND noninteractive
RUN \
apt-get -qq update --yes && \
apt-get -qq upgrade --yes && \
apt-get -qq install --yes --no-install-recommends \
build-essential \
git \
libyaml-dev \
tini \
> /dev/null && \
apt-get -qq clean && \
rm -rf /var/lib/apt/lists/* && \
pip install -U pip setuptools wheel
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
FROM binaries AS source
COPY . .
FROM source AS pre-commit
RUN \
pip install ".[dev]"
CMD pre-commit run --all-files
FROM source AS test
RUN \
pip install ".[dev]"
CMD pytest
FROM source AS build-wheel
CMD pip wheel --no-deps -w ./dist .
FROM binaries AS install-wheel
CMD pip install --find-links=./dist cfgenvy[dev]