forked from arcalot/arcaflow-plugin-template-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (38 loc) · 1.55 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
45
46
47
48
49
50
51
52
53
# build poetry
FROM quay.io/centos/centos:stream8 as poetry
RUN dnf -y module install python39 && dnf -y install python39 python39-pip
WORKDIR /app
COPY poetry.lock /app/
COPY pyproject.toml /app/
RUN python3.9 -m pip install poetry \
&& python3.9 -m poetry config virtualenvs.create false \
&& python3.9 -m poetry install --without dev \
&& python3.9 -m poetry export -f requirements.txt --output requirements.txt --without-hashes
ENV package arcaflow_plugin_template_python
# run tests
COPY ${package}/ /app/${package}
COPY tests /app/tests
RUN mkdir /htmlcov
RUN pip3 install coverage
RUN python3 -m coverage run tests/test_example_plugin.py
RUN python3 -m coverage html -d /htmlcov --omit=/usr/local/*
# final image
FROM quay.io/centos/centos:stream8
ENV package arcaflow_plugin_template_python
RUN dnf -y module install python39 && dnf -y install python39 python39-pip
WORKDIR /app
COPY --from=poetry /app/requirements.txt /app/
COPY --from=poetry /htmlcov /htmlcov/
COPY LICENSE /app/
COPY README.md /app/
COPY ${package}/ /app/${package}
RUN python3.9 -m pip install -r requirements.txt
WORKDIR /app/${package}
ENTRYPOINT ["python3", "example_plugin.py"]
CMD []
LABEL org.opencontainers.image.source="https://github.com/arcalot/arcaflow-plugin-template-python"
LABEL org.opencontainers.image.licenses="Apache-2.0+GPL-2.0-only"
LABEL org.opencontainers.image.vendor="Arcalot project"
LABEL org.opencontainers.image.authors="Arcalot contributors"
LABEL org.opencontainers.image.title="Python Plugin Template"
LABEL io.github.arcalot.arcaflow.plugin.version="1"