2017-08-23 10:59:17 +00:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Make database writable
|
|
|
|
chown -R guest "$DB_DIR"
|
|
|
|
|
|
|
|
if [ "$1" = 'dev' ]; then
|
2017-08-25 12:08:01 +00:00
|
|
|
export DJANGO_ENV='development'
|
2017-08-23 10:59:17 +00:00
|
|
|
exec python3 manage.py runserver 0.0.0.0:8000
|
|
|
|
elif [ "$1" = 'prod' ]; then
|
2017-08-25 12:08:01 +00:00
|
|
|
export DJANGO_ENV='production'
|
2017-08-23 10:59:17 +00:00
|
|
|
# Collect static files
|
|
|
|
python3 manage.py collectstatic --noinput --clear -v 0
|
2017-08-25 12:14:01 +00:00
|
|
|
# translations generation
|
|
|
|
python3 manage.py compilemessages
|
2017-08-23 10:59:17 +00:00
|
|
|
exec uwsgi --ini uwsgi.ini --pythonpath "$APPS_DIR" --static-map=/static/="$STATIC_ROOT"
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec "$@"
|