-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
54 lines (39 loc) · 1.25 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 python:3.9-alpine
COPY . /app
COPY example_config.py /app/config.py
WORKDIR /app
RUN apk update
RUN pip install --no-cache-dir --upgrade \
pip \
setuptools \
wheel
RUN set -x ; \
addgroup -g 82 -S www-data ; \
adduser -u 82 -D -S -G www-data www-data && exit 0 ; exit 1
RUN apk add --update \
bash \
tmux \
mariadb-client \
sshpass \
openssh-client \
apache2 \
apache2-dev \
gcc \
g++ \
make \
openblas \
musl \
py3-numpy \
py3-numpy-dev
ENV PYTHONPATH=/usr/lib/python3.9/site-packages
RUN pip install --no-cache-dir -r docker/docker-requirements.txt
# This fixes an issue with "py3-numpy" where python won't find additional modules because of an musl vs. gcc error... credit: https://stackoverflow.com/a/69360361
RUN find /usr/lib/python3.9/site-packages -iname "*.so" -exec sh -c 'x="{}"; mv "$x" "${x/cpython-39-x86_64-linux-musl./}"' \;
RUN chmod +x ./docker/wait-for-it.sh
RUN chmod 764 /app/ -R
RUN chown www-data:www-data /app/ -R
EXPOSE 8000
CMD tmux new -d -s wsgi 'mod_wsgi-express start-server docker/docker-wsgi.wsgi --user www-data --group www-data' ; \
mkdir -p /tmp/mod_wsgi-localhost:8000:0/ ; \
touch /tmp/mod_wsgi-localhost:8000:0/error_log ; \
tail -f /tmp/mod_wsgi-localhost:8000:0/error_log