CoEDL / elpis

🙊 software for creating speech recognition models.
https://elpis.readthedocs.io/en/latest/
Apache License 2.0
152 stars 33 forks source link

Make Flask start in production mode #236

Closed benfoley closed 2 years ago

benfoley commented 3 years ago

It would be safer for the docker image to have flask start in production mode and manually set it to dev mode (using ENV) when developing.

What needs to be done to make it actually production server?

If I specify FLASK_ENV=production poetry run flask run --host=0.0.0.0 --port=5000 then I get this response:

 * Serving Flask app "elpis"
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off

Is that sufficient? Ignore the WARNING?

benfoley commented 3 years ago

note to self: https://flask.palletsprojects.com/en/2.0.x/tutorial/deploy/

nicklambourne commented 3 years ago

If we were using it for a real web server we'd use something like uwsgi. It's fine to ignore the warning.