-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
100 lines (87 loc) · 2.37 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
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
FROM python:3.7-alpine3.14
WORKDIR /app
COPY ./requirements.txt /app/requirements.txt
# upgrade pip
RUN python -m pip install --upgrade pip
RUN apk add --no-cache \
lapack \
libstdc++ \
ca-certificates \
tzdata \
redis \
bash \
libjpeg \
libpng \
libwebp \
tiff \
openblas
# install python requirements
RUN apk add --no-cache --virtual .build-deps \
g++ \
make \
cmake \
gcc \
lapack-dev \
gfortran \
libjpeg-turbo-dev \
libpng-dev \
tiff-dev \
libwebp-dev \
freetype-dev \
libexecinfo-dev \
openblas-dev \
libgomp \
libffi-dev \
python3-dev \
openssl-dev \
libexecinfo-dev \
freetype-dev \
libquadmath && \
pip install --no-cache-dir -r /app/requirements.txt && \
apk del .build-deps
# install tlsh
RUN apk add --no-cache --virtual .build-deps \
gcc \
g++ \
cmake \
make \
wget && \
mkdir -p /tmp/tlsh && \
wget https://github.com/trendmicro/tlsh/archive/refs/tags/4.8.2.tar.gz -O /tmp/tlsh/source.tar.gz && \
tar --strip-components=1 -xf /tmp/tlsh/source.tar.gz && \
./make.sh && \
cd py_ext/ && \
python ./setup.py build && \
python ./setup.py install && \
cd ../Testing && \
./python_test.sh && \
cd /tmp && \
rm -rf /tmp/tlsh
# install envsubst
RUN \
apk add --no-cache --virtual .gettext gettext && \
mv /usr/bin/envsubst /tmp/ && \
runDeps="$( \
scanelf --needed --nobanner /tmp/envsubst \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" && \
apk add --no-cache $runDeps && \
apk del .gettext && \
mv /tmp/envsubst /usr/local/bin/
COPY ./logging.ini.template /app/logging.ini.template
COPY ./carlhauser_server /app/carlhauser_server
COPY ./carlhauser_client/API/extended_api.py /app/carlhauser_client/API/extended_api.py
COPY ./carlhauser_client/API/simple_api.py /app/carlhauser_client/API/simple_api.py
COPY ./carlhauser_client/Helpers/dict_utilities.py /app/carlhauser_client/Helpers/dict_utilities.py
COPY ./carlhauser_client/cert.pem /app/carlhauser_client/cert.pem
COPY ./common /app/common
COPY ./start.sh /app/start.sh
ENV CARLHAUSER_HOME /app/
ENV PYTHONPATH /app/
ENV DEBUG_LEVEL INFO
VOLUME [ "/app/storage", "/app/carlhauser_server/Data/database_data" ]
EXPOSE 443
CMD [ "./start.sh" ]