-1

I was given SSH access to a fedora server in which I have cloned a flask application. After setting up a python environment and installing the app python modules I'm able to run the application from terminal with:

python3 run.py

And from my browser I can see the app running from url:

http://someurl.com:5000/

I understand Werkzeug's server is only meant for development, but I'm not finding specific information for deployment on a fedora server.

Is nginx a good option?

How do I deploy my flask app on a fedora server.?

user2300867
  • 593
  • 1
  • 12
  • 28

1 Answers1

1

I believe this can be solved by using gunicorn and nginx to run your app rather than directly with python.

Install gunicorn using pip install then use this command to run it:

gunicorn -b localhost:8000 -w 4 <your_webapp>:app

You will then need to set up nginx to listen on the correct ports. I have included a link below which will take you through the whole process from start to finish.

https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux

Poorna Senani Gamage
  • 1,246
  • 2
  • 19
  • 30
AHB
  • 31
  • 4