From 851de8b219f385f079e19df83957ebf0c6826572 Mon Sep 17 00:00:00 2001 From: meme-lord Date: Fri, 10 Nov 2023 12:28:29 +0000 Subject: [PATCH] use gunicorn instead of the flask development server --- docker-compose.yml | 1 + services/api/requirements.txt | 1 + services/api/wsgi.py | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 services/api/wsgi.py diff --git a/docker-compose.yml b/docker-compose.yml index 06fa3f0..f0c755b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,7 @@ services: - internal volumes: - ${TRAFFIC_DIR_HOST}:${TRAFFIC_DIR_DOCKER}:ro + command: "gunicorn -w 3 -t 60 --log-level debug --capture-output --enable-stdio-inheritance -b 0.0.0.0:5000 webservice:application" environment: TULIP_MONGO: mongo:27017 TULIP_TRAFFIC_DIR: ${TRAFFIC_DIR_DOCKER} diff --git a/services/api/requirements.txt b/services/api/requirements.txt index 3f28156..5676adc 100644 --- a/services/api/requirements.txt +++ b/services/api/requirements.txt @@ -2,3 +2,4 @@ Flask_Cors pymongo Flask requests +gunicorn \ No newline at end of file diff --git a/services/api/wsgi.py b/services/api/wsgi.py new file mode 100644 index 0000000..6c9633d --- /dev/null +++ b/services/api/wsgi.py @@ -0,0 +1,4 @@ +from webservice import application + +if __name__ == "__main__": + application.run(host='0.0.0.0', threaded=True) \ No newline at end of file