From cca98c1cf8ecdf39efe142eb0d10c79f337dbfac Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 21 Mar 2024 14:31:45 +0100 Subject: [PATCH] idhub entrypoint: add gunicorn --- docker/idhub.entrypoint.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) 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 "${@}"