-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
48 lines (36 loc) · 1.05 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
FROM python:3.10-alpine
COPY . /app
WORKDIR /app
RUN rm persistant/ -r || :
RUN rm config.py || :
RUN mv config-docker.py config.py
# Update alpine packages.
RUN apk update
# Update or install pip, setuptools and wheel.
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 \
apache2 \
apache2-dev \
gcc \
g++ \
make \
openblas \
musl
# Install python dependencies from requirements.txt.
RUN pip install --install-option="--force-pi" --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir -r requirements-docker.txt
ENV PYTHONPATH=/usr/lib/python3.10/site-packages
RUN chown www-data:www-data /app/ -R
EXPOSE 8000
CMD tmux new -d -s wsgi 'mod_wsgi-express start-server app.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