Compare commits

...

2 commits

Author SHA1 Message Date
pedro cca98c1cf8 idhub entrypoint: add gunicorn 2024-03-21 14:32:17 +01:00
pedro 9a14a3f3da idhub entrypoint: refactor check_app_is_there 2024-03-21 13:54:11 +01:00

View file

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