Use a config file for uwsgi.

This commit is contained in:
Abhilash Raj
2017-05-28 14:20:39 -07:00
parent f920f88165
commit 7bc5bf5dc4
4 changed files with 24 additions and 37 deletions

View File

@@ -49,8 +49,9 @@ if [[ ! -v DATABASE_URL ]]; then
echo "DATABASE_URL is not defined. Using sqlite database..."
export DATABASE_URL=sqlite://mailmanweb.db
export DATABASE_TYPE='sqlite'
else
export DATABASE_TYPE='postgres'
fi
if [[ "$DATABASE_TYPE" = 'postgres' ]]; then
wait_for_postgres
fi
@@ -88,20 +89,4 @@ python manage.py collectstatic --noinput
# this command will upgrade the database.
python manage.py migrate
# Log to the default location /opt/mailman-web-data/logs/uwsgi.log if the
# logging variable is not set.
if [[ ! -v UWSGI_LOGTO ]]; then
echo "No UWSGI_LOGTO defined, logging uwsgi to /opt/mailman-web-data/logs/uwsgi.log ..."
export UWSGI_LOGTO='/opt/mailman-web-data/logs/uwsgi.log'
touch "$UWSGI_LOGTO"
fi
if [[ ! -v UWSGI_WSGI_FILE ]]; then
export UWSGI_WSGI_FILE="wsgi.py"
export UWSGI_HTTP=:8000
export UWSGI_WORKERS=2
export UWSGI_THREADS=4
fi
exec $@