diff options
author | Pjotr Prins | 2021-08-07 12:06:49 +0200 |
---|---|---|
committer | Pjotr Prins | 2021-08-07 12:06:49 +0200 |
commit | e0476d51603432f60b6412b65486166deabe9e08 (patch) | |
tree | d201eb44bb0490dfeb3e9d87386adc866591db54 /README.md | |
parent | 33700066452e3c5f341b790f015f85fb976d06be (diff) | |
download | genenetwork3-e0476d51603432f60b6412b65486166deabe9e08.tar.gz |
Add gunicorn support for production
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -61,12 +61,33 @@ mypy . #### Running the flask app -To spin up the server: +To spin up the server on its own (for development): ```bash env FLASK_DEBUG=1 FLASK_APP="main.py" flask run --port=8080 ``` +And test with + +``` +curl localhost:8080/api/version +"1.0" +``` + +To run with gunicorn + +``` +gunicorn --bind 0.0.0.0:8080 wsgi:app +``` + +consider the following options for development `--bind 0.0.0.0:$SERVER_PORT --workers=1 --timeout 180 --reload wsgi`. + +And for the scalable production version run + +``` +gunicorn --bind 0.0.0.0:8080 --workers 8 --keep-alive 6000 --max-requests 10 --max-requests-jitter 5 --timeout 1200 wsgi:app +``` + ##### Using python-pip IMPORTANT NOTE: we do not recommend using pip tools, use Guix instead |