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

set -e

5
6
tar --extract --xz --file=/usr/src/app/docs.tar.xz --directory=/concrexit/docs/
chown -R www-data:www-data /concrexit/
7

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