-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
57 lines (56 loc) · 2.12 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
FROM archlinux:base-20210131.0.14634
RUN useradd --home-dir /app --uid 1000 app && mkdir -p /app/log /app/media && chown -R app /app
WORKDIR /app
RUN echo '[testing]' >> /etc/pacman.conf
RUN echo Include = /etc/pacman.d/mirrorlist >> /etc/pacman.conf
RUN pacman -Syu --noconfirm vim mailcap which gettext python python-pillow python-psycopg2 python-pip python-psutil git curl uwsgi uwsgi-plugin-python python make gcc cython pkg-config graphviz libsodium libsecp256k1 go-ipfs && rm -rf /var/cache/pacman/pkg
RUN pip3 install --upgrade pip wheel
ENV PYTHONIOENCODING=UTF-8 PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
ENV PATH=/app/node_modules/.bin:/app/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN mkdir -p /spooler/blockchain /spooler/email /spooler/tally && chown -R app /spooler
COPY requirements.txt /app
RUN pip3 install -Ur /app/requirements.txt
COPY . /app/
RUN DEBUG= ./manage.py ryzom_bundle
RUN DEBUG= ./manage.py compilemessages
RUN chown -R app. /app/log
USER app
EXPOSE 8000
CMD /usr/bin/bash -euxc "until djcli dbcheck; do sleep 1; done \
&& ./manage.py compilescss \
&& ./manage.py collectstatic --noinput \
&& ./manage.py migrate --noinput \
&& find public -type f | xargs gzip -f -k -9 \
&& uwsgi \
--http-socket=0.0.0.0:8000 \
--chdir=/app \
--plugin=python \
--spooler=/spooler/blockchain \
--spooler=/spooler/email \
--spooler=/spooler/tally \
--spooler-processes=8 \
--spooler-frequency=1 \
--spooler-chdir=/app \
--module=electeez_common.wsgi:application \
--http-keepalive \
--harakiri=1024 \
--max-requests=100 \
--master \
--workers=12 \
--processes=6 \
--chmod=666 \
--log-5xx \
--vacuum \
--enable-threads \
--post-buffering=8192 \
--ignore-sigpipe \
--ignore-write-errors \
--disable-write-exception \
--mime-file /etc/mime.types \
--thunder-lock \
--offload-threads '%k' \
--route '^/static/.* addheader:Cache-Control: public, max-age=7776000' \
--route '^/js|css|fonts|images|icons|favicon.png/.* addheader:Cache-Control: public, max-age=7776000' \
--static-map /static=/app/public \
--static-map /media=/app/media \
--static-gzip-all"