-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
54 lines (37 loc) · 1.51 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
FROM dockerhub.apps.cp.meteoswiss.ch/mch/python-3.10 AS builder
COPY poetry.lock /src/app-root/
COPY pyproject.toml /src/app-root/
COPY src/ /src/app-root/src/
COPY README.md /src/app-root/
RUN cd /src/app-root \
# we need to build the wheel in order to install the binary python \
# package that uses click to parse the command arguments
&& poetry build --format wheel \
&& poetry export --without-hashes -o requirements.txt \
&& poetry export --without-hashes --dev -o requirements_dev.txt
FROM dockerhub.apps.cp.meteoswiss.ch/mch/python-3.10:latest-slim AS base
COPY --from=builder /src/app-root/dist/*.whl /src/app-root/
COPY --from=builder /src/app-root/requirements.txt /src/app-root/
RUN pip install -r /src/app-root/requirements.txt \
&& pip install /src/app-root/*.whl --no-deps \
&& rm /src/app-root/*.whl
WORKDIR /src/app-root
FROM base AS runner
RUN mkdir /src/app-root/data /src/app-root/output
ENV HTTPS_PROXY=\
HTTP_PROXY=\
http_proxy=\
https_proxy=\
NO_PROXY=\
no_proxy=
ENTRYPOINT ["pyflexplot"]
FROM base AS tester
COPY --from=builder /src/app-root/requirements_dev.txt /src/app-root/requirements_dev.txt
RUN pip install -r /src/app-root/requirements_dev.txt
COPY tests /src/app-root/tests
COPY pyproject.toml test_ci.sh /src/app-root/
CMD ["/bin/bash", "-c", "source /src/app-root/test_ci.sh && run_ci_tools"]
FROM tester AS documenter
COPY doc /src/app-root/doc
COPY CONTRIBUTING.md HISTORY.md README.md /src/app-root/
CMD ["sphinx-build", "doc", "doc/_build"]