forked from baloise/gitopscli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (39 loc) · 882 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
47
48
49
50
51
52
53
54
# =========
FROM python:3.10-alpine AS base
ENV PATH="/opt/venv/bin:$PATH"
RUN apk add --no-cache git
# =========
FROM base AS dev
WORKDIR /workdir
RUN apk add --no-cache gcc linux-headers musl-dev make
RUN python -m venv /opt/venv
RUN pip install --upgrade pip
# =========
FROM dev AS deps
COPY setup.py .
RUN pip install .
# =========
FROM deps AS test
COPY requirements-test.txt .
RUN pip install -r requirements-test.txt
COPY . .
RUN pip install .
RUN make checks
# =========
FROM dev AS docs
COPY requirements-docs.txt .
RUN pip install -r requirements-docs.txt
COPY docs ./docs
COPY CONTRIBUTING.md mkdocs.yml ./
RUN mkdocs build
# =========
FROM scratch AS docs-site
COPY --from=docs /workdir/site /site
# =========
FROM deps AS install
COPY . .
RUN pip install .
# =========
FROM base as final
COPY --from=install /opt/venv /opt/venv
ENTRYPOINT ["gitopscli"]