At some point, the flask needs to come with stand alone HTTP server in production. Fortunately, there are several options that we can choose to run flask_cm application.
Gunicorn looks quite simple so it would be better to leave a short note here.
- Install gunicorn:
pip install gunicorn
- Run gunicorn:
gunicorn flask_cm/server:app
- With other options:
gunicorn -w 4 -b 127.0.0.1:5000 flask_cm/server:app
- (-w number of workers, -b binding name with port number)
Also, we can add a proxy server to protect services from any type of compromising situations. Gunicorn can comes with Nginx.