entrypoint_production.sh 782 Bytes
Newer Older
Thom Wiggers's avatar
Thom Wiggers committed
1
2
3
4
#!/bin/bash

set -e

5
>&2 echo "Creating Sphinx documentation"
6
sphinx-build -b html /usr/src/app/docs/ /concrexit/docs/
7

Thom Wiggers's avatar
Thom Wiggers committed
8
until psql -h "$DJANGO_POSTGRES_HOST" -U "postgres" -c '\l' $POSTGRES_DB; do
Thom Wiggers's avatar
Thom Wiggers committed
9
10
11
12
13
    >&2 echo "PostgreSQL is unavailable: Sleeping"
    sleep 5
done
>&2 echo "PostgreSQL is up"

14
chown -R www-data:www-data /concrexit/
Thom Wiggers's avatar
Thom Wiggers committed
15

16
cd /usr/src/app/website/
Thom Wiggers's avatar
Thom Wiggers committed
17
>&2 echo "Running site with uwsgi"
18
uwsgi --chdir /usr/src/app/website \
Thom Wiggers's avatar
Thom Wiggers committed
19
    --socket :8000 \
Thom Wiggers's avatar
Thom Wiggers committed
20
    --socket-timeout 1800 \
Thom Wiggers's avatar
Thom Wiggers committed
21
22
23
24
    --uid 33 \
    --gid 33 \
    --threads 5 \
    --processes 5 \
Thom Wiggers's avatar
Thom Wiggers committed
25
    --module thaliawebsite.wsgi:application \
Thom Wiggers's avatar
Thom Wiggers committed
26
    --harakiri 1800 \
Thom Wiggers's avatar
Thom Wiggers committed
27
    --master \
Thom Wiggers's avatar
Thom Wiggers committed
28
29
    --max-requests 5000 \
    --vacuum \
Thom Wiggers's avatar
Thom Wiggers committed
30
31
    --limit-post 0 \
    --post-buffering 16384 \
32
    --thunder-lock \
Thom Wiggers's avatar
Thom Wiggers committed
33
    --logto '/concrexit/log/uwsgi.log'