Using ML model to predict Life Expectancy for each country and how to deploy a Python Flask application to Heroku.
- Local run for testing - run as a python file
server.pywithout Gunicorn locally. Since environment variable'PORT'does not exist, will listen on default Flask port5000onlocalhostonly. - Heroku without Gunicorn - run as a python file
server.pywithout Gunicorn on Heroku. Use the following line inProcfile:web: python server.py. Will listen on port given by Heroku in environment variablePORT - Heroku with Gunicorn - change
Procfilefile to:web: gunicorn server:app. Then Gunicorn will run inside Heroku dyno with multiple instances of theserver.pyspecified by Heroku in environment variableWEB_CONCURRENCYdepending on available and used memory in the dyno.