This repository has been archived by the owner on Jun 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
executable file
·72 lines (43 loc) · 1.78 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# This is a multi-stage Dockerfile, it may look a bit complicated because it's trying to do so many interconnected things
# See build.sh for how to run it
# First of all, let's get a nice Python environment
FROM python:3.9 as core
RUN touch /tmp/one_ring_to_bind_them_all
WORKDIR /app/
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
RUN poetry --version
COPY pyproject.toml .
COPY poetry.lock .
RUN poetry install --no-root
#-------------------
FROM core as collect_source
COPY act/*.py act/
#-------------------
FROM core as check_types_make_sense
COPY --from=collect_source /app/act act
COPY lint/ act/lint/
RUN poetry run mypy -p act --config-file act/lint/mypy.ini
COPY .pylintrc .
RUN poetry run pylint act/
#-------------------
FROM core as check_formatting_is_reasonable
COPY --from=collect_source /app/act act
RUN poetry run black --check --diff act/
#-------------------
FROM core as run_all_the_unit_tests
COPY --from=collect_source /app/act act
COPY test act/test
RUN poetry run pytest --numprocesses=auto
#-------------------
FROM collect_source as check_the_program_is_basically_functional
RUN poetry run python -m act.act --help | grep "heatpump"
#-------------------
# Now reference all the targets in a single step so they all get run before we produce this output
FROM collect_source as runtime
COPY --from=check_types_make_sense /tmp/one_ring_to_bind_them_all /tmp/
COPY --from=check_formatting_is_reasonable /tmp/one_ring_to_bind_them_all /tmp/
COPY --from=run_all_the_unit_tests /tmp/one_ring_to_bind_them_all /tmp/
COPY --from=check_the_program_is_basically_functional /tmp/one_ring_to_bind_them_all /tmp/
ENV PYTHONWARNINGS="ignore:Unverified HTTPS request"
ENTRYPOINT ["poetry","run","python","-m","act.act","--dry-run" ]