summaryrefslogtreecommitdiff
path: root/entrypoint.sh
blob: 8e77e10024dde7a2482e617b360ab87c5ae30375 (plain)
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
#!/bin/bash
set -ex

PORT=${PORT:-9000}
UWSGI_TIMEOUT=${UWSGI_TIMEOUT:-300}

PROMENADE_THREADS=${PROMENADE_THREADS:-1}
PROMENADE_WORKERS=${PROMENADE_WORKERS:-4}

if [ "$1" = 'server' ]; then
    exec uwsgi \
        --http ":${PORT}" \
        --http-timeout "${UWSGI_TIMEOUT}" \
        --harakiri "${UWSGI_TIMEOUT}" \
        --socket-timeout "${UWSGI_TIMEOUT}" \
        --harakiri-verbose \
        -b 32768 \
        --lazy-apps \
        --master \
        --thunder-lock \
        --die-on-term \
        -z "${UWSGI_TIMEOUT}" \
        --paste config:/etc/promenade/api-paste.ini \
        --enable-threads \
        --threads "${PROMENADE_THREADS}" \
        --workers "${PROMENADE_WORKERS}"
fi

exec ${@}