diff --git a/entrypoint.sh b/entrypoint.sh index 49d79d5..8854580 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,4 +8,5 @@ if [[ -f "initial_setup" ]]; then rm initial_setup fi -uwsgi uwsgi.ini +cd query_server +gunicorn server:app \ No newline at end of file diff --git a/query_server/gunicorn.conf.py b/query_server/gunicorn.conf.py new file mode 100644 index 0000000..f79ae0b --- /dev/null +++ b/query_server/gunicorn.conf.py @@ -0,0 +1,12 @@ +import os + +bind = "0.0.0.0:3000" +workers = int(os.getenv("WORKERS", 4)) +threads = int(os.getenv("THREADS", 4)) +user = "candig" +group = "candig" +loglevel = 'debug' +accesslog = '-' +access_log_format = 'INFO\t%(m)s\t%(U)s\t%(b)s\t%(M)s\t%(s)s' +capture_output = True +syslog = True diff --git a/query_server/wsgi.py b/query_server/wsgi.py deleted file mode 100644 index de91da7..0000000 --- a/query_server/wsgi.py +++ /dev/null @@ -1,4 +0,0 @@ -from server import app - -if __name__ == "__main__": - app.run() \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index c11f656..a42f5fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ Flask==2.2.5 Flask-Cors==5.0.0 pytest==7.2.0 connexion==2.14.2 -uwsgi==2.0.23 +gunicorn>=23.0.0 swagger-ui-bundle==0.0.9 candigv2-authx@git+https://github.com/CanDIG/candigv2-authx.git@v2.4.2 candigv2-logging@git+https://github.com/CanDIG/candigv2-logging.git@v1.0.0 diff --git a/uwsgi.ini b/uwsgi.ini deleted file mode 100644 index 73af76c..0000000 --- a/uwsgi.ini +++ /dev/null @@ -1,14 +0,0 @@ -[uwsgi] -module = wsgi:app -chdir = query_server -http = 0.0.0.0:3000 - -log-master = true -processes = 4 - -gid = candig -uid = candig - -harakiri = 60 - -route = /service-info donotlog: