-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile.presenters
102 lines (79 loc) · 2.11 KB
/
Dockerfile.presenters
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
FROM python:3.13-alpine3.21 AS build_shared
WORKDIR /build_shared/
RUN pip install --no-cache-dir build
COPY ./src/shared/. .
RUN python -m build
FROM python:3.13-alpine3.21 AS production
WORKDIR /app/
# upgrade pip
RUN python -m pip install --upgrade pip
# install common packages
RUN \
apk add --no-cache \
libpng \
libjpeg \
py3-gobject3 \
pango
# install fonts
RUN \
apk add --no-cache \
msttcorefonts-installer \
fontconfig \
font-noto \
font-noto-arabic \
font-noto-armenian \
font-noto-bengali \
font-noto-devanagari \
font-noto-ethiopic \
font-noto-extra \
font-noto-georgian \
font-noto-hebrew \
font-noto-kannada \
font-noto-lao \
font-noto-malayalam \
font-noto-myanmar \
font-noto-tamil \
font-noto-thai \
font-noto-tibetan \
terminus-font \
ttf-opensans \
font-bakoma \
font-misc-misc \
font-croscore \
freetype && \
fc-cache -f && \
update-ms-fonts && \
rm -rf /var/cache/*
# install "shared" package from build_shared stage
# TODO: somehow squash the following two layers into one to conserve space
COPY --from=build_shared /build_shared/dist/taranis_ng_shared-*.whl custom_packages/
RUN pip install --no-cache-dir ./custom_packages/taranis_ng_shared-*.whl && rm -rf ./custom_packages/
# install dependencies
COPY ./src/presenters/requirements.txt /app/requirements.txt
RUN \
apk add --no-cache --virtual .build-deps \
gcc \
g++ \
make \
musl-dev \
python3-dev \
libffi-dev && \
pip install --no-cache-dir -r /app/requirements.txt && \
apk --purge del .build-deps
COPY ./docker/start.sh /start.sh
RUN chmod +x /start.sh
COPY ./docker/prestart.sh /app/prestart.sh
RUN chmod +x /app/prestart.sh
COPY ./docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
COPY ./docker/gunicorn_conf.py /gunicorn_conf.py
COPY ./src/presenters/. /app/
EXPOSE 80
# setup environment variables
ENV PYTHONPATH=/app
ENV MODULE_NAME run
ENV VARIABLE_NAME app
ENV GUNICORN_CMD_ARGS --timeout 120
VOLUME ["/app/templates"]
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/start.sh"]