diff --git a/deployment/django/entrypoint.sh b/deployment/django/entrypoint.sh index de124f2..8f50543 100755 --- a/deployment/django/entrypoint.sh +++ b/deployment/django/entrypoint.sh @@ -30,18 +30,13 @@ else ) fi -GUNICORN_CMD_ARGS=<<'EOF' - --config /django/gunicorn.conf.py - --bind "$(hostname):8000" -EOF - ( set -x ./manage.py collectstatic --noinput ./manage.py migrate - su django -c "/usr/local/bin/gunicorn wsgi" + su django -c "/usr/local/bin/gunicorn --config /django/gunicorn.conf.py wsgi" echo "gunicorn terminated with exit code: $?" sleep 3 diff --git a/deployment/django/gunicorn.conf.py b/deployment/django/gunicorn.conf.py index 1561694..8818b58 100644 --- a/deployment/django/gunicorn.conf.py +++ b/deployment/django/gunicorn.conf.py @@ -4,6 +4,8 @@ import multiprocessing +bind = 'django:8000' + # https://docs.gunicorn.org/en/latest/settings.html#workers workers = multiprocessing.cpu_count() * 2 + 1