idhub entrypoint: add gunicorn

This commit is contained in:
pedro 2024-03-21 14:31:45 +01:00
parent 9a14a3f3da
commit cca98c1cf8
1 changed files with 9 additions and 8 deletions

View File

@ -99,9 +99,14 @@ config_oidc4vp() {
done done
} }
main() { runserver() {
idhub_dir='/opt/idhub' if [ ! "${DEBUG:-}" = "true" ]; then
cd "${idhub_dir}" ./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() { check_app_is_there() {
if [ ! -f "./manage.py" ]; then if [ ! -f "./manage.py" ]; then
@ -119,11 +124,7 @@ main() {
inject_env_vars inject_env_vars
if [ ! "${DEBUG:-}" = "true" ]; then runserver
./manage.py collectstatic
fi
./manage.py runserver 0.0.0.0:${PORT}
} }
main "${@}" main "${@}"