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
}
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 "${@}"