-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.build
50 lines (39 loc) · 1.22 KB
/
Dockerfile.build
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
# syntax=docker/dockerfile:1
FROM qoopido/telerising.builder:latest AS build
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
ENV WORKDIR=/var/app
WORKDIR ${WORKDIR}
COPY telerising ${WORKDIR}/
COPY root /
RUN mv run.py telerising.py \
&& python3 -OO -m nuitka \
--standalone \
--follow-stdlib \
--prefer-source-code \
--python-flag=-S,-OO \
--plugin-enable=anti-bloat,implicit-imports,data-files,pylint-warnings \
--include-data-dir=./app/static=app/static \
--include-data-dir=./app/templates=app/templates \
--warn-implicit-exceptions \
--warn-unusual-code \
./telerising.py
RUN cd telerising.dist/ \
&& mv ./telerising.bin ./telerising \
&& /usr/local/sbin/processLibs
RUN cd telerising.dist/ \
&& strip --strip-unneeded --strip-debug telerising \
&& upx --best --overlay=strip telerising
RUN cd /var/dist \
&& cp -r ${WORKDIR}/telerising.dist/* ./
FROM scratch AS dist
ARG TARGETPLATFORM
ARG TARGETARCH
ARG TARGETVARIANT
COPY --from=tarampampam/curl:latest /bin/curl /bin/curl
COPY --from=build /var/dist/ /
HEALTHCHECK --interval=30s --timeout=6s --retries=5 --start-period=30s CMD [ \
"/bin/curl", "--fail", "http://127.0.0.1:5000/" \
]
ENTRYPOINT [ "/telerising" ]