forked from rapidpro/rapidpro
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathstart
31 lines (26 loc) · 959 Bytes
/
start
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
#!/bin/bash
#set -o errexit
#set -o pipefail
#set -o nounset
if [ ! -z "${BRANDING_FILES}" ]; then
git clone -b $BRANDING_BRANCH $BRANDING_FILES $PROJECT_PATH/$BRANDING_SLUG/
mv $PROJECT_PATH/$BRANDING_SLUG/$BRANDING_SLUG/ $PROJECT_PATH/static/brands/
fi
su $PROJECT_USER -c "python manage.py collectstatic --noinput"
if [ "${COMPRESS_ENABLED}" = true ]; then
python manage.py compress --extension=.haml,.html --force
fi
echo "Starting nginx..."
service nginx start # TODO: Update after change the user from root
echo "Done!"
echo "Starting server..."
#gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.sock temba.wsgi:application
exec gunicorn temba.wsgi:application \
--name=$PROJECT \
--user=$PROJECT_USER \
--chdir=$PROJECT_PATH \
--bind=0.0.0.0:8001 \
--timeout=120 \
--log-level=info \
--log-config=$PROJECT_PATH/docker/gunicorn/gunicorn-logging.conf \
-c $PROJECT_PATH/docker/gunicorn/gunicorn.conf.py