Your question
Hi,
I've installed eventlet as mentioned in the documentation. I have a server.py file which says:
app = Flask(__name__)
socketio = SocketIO(app, async_mode='eventlet')
if __name__ == '__main__':
socketio.run(app, host='0.0.0.0')
To run the server I do:
nohup python3 server.py &
Is this the best way to run a server for Production?
I'm not sure it is the "best" way, but it is definitely a good way. I would not start the server just by running server.py though, instead I would create a systemd service file or similar, so that the process is monitored and restarted in the event of a power cycle or a crash.
Thank you for your advice.
I tried creating a user service and will test it over the next few days.
Refer: https://github.com/torfsen/python-systemd-tutorial
Most helpful comment
I'm not sure it is the "best" way, but it is definitely a good way. I would not start the server just by running
server.pythough, instead I would create a systemd service file or similar, so that the process is monitored and restarted in the event of a power cycle or a crash.