diff --git a/docker/idhub.entrypoint.sh b/docker/idhub.entrypoint.sh index 3a22aef..91bd098 100755 --- a/docker/idhub.entrypoint.sh +++ b/docker/idhub.entrypoint.sh @@ -99,9 +99,14 @@ config_oidc4vp() { done } -main() { - idhub_dir='/opt/idhub' - cd "${idhub_dir}" +runserver() { + if [ ! "${DEBUG:-}" = "true" ]; then + ./manage.py collectstatic + gunicorn --access-logfile - --error-logfile - --workers 4 -b :${PORT} trustchain_idhub.wsgi:application + else + ./manage.py runserver 0.0.0.0:${PORT} + fi +} check_app_is_there() { if [ ! -f "./manage.py" ]; then @@ -119,11 +124,7 @@ main() { inject_env_vars - if [ ! "${DEBUG:-}" = "true" ]; then - ./manage.py collectstatic - fi - - ./manage.py runserver 0.0.0.0:${PORT} + runserver } main "${@}"