-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathbootstrap.sh
More file actions
29 lines (21 loc) · 734 Bytes
/
bootstrap.sh
File metadata and controls
29 lines (21 loc) · 734 Bytes
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/sh
set -e
if [ "$BACKUP_ENABLE" = "TRUE" ] || [ "$BACKUP_ENABLE" = True ] || [ "$CONSUME_ENABLE" = "TRUE" ] || [ "$CONSUME_ENABLE" = True ]; then
python .venv/bin/supervisord -c supervisord.conf
fi
cd pdfding
if [ "$DATABASE_TYPE" = "POSTGRES" ]
then
POSTGRES_HOST="${POSTGRES_HOST:-postgres}"
POSTGRES_PORT="${POSTGRES_PORT:-5432}"
echo "Waiting for postgres..."
while ! nc -z $POSTGRES_HOST $POSTGRES_PORT; do
sleep 0.1
done
echo "PostgreSQL started"
fi
HOST_PORT="${HOST_PORT:-8000}"
python manage.py migrate
python manage.py clean_up
WORKER_TIMEOUT="${WORKER_TIMEOUT:-30}"
exec python -m gunicorn --bind 0.0.0.0:$HOST_PORT --workers 3 --timeout $WORKER_TIMEOUT core.wsgi:application