Configure Docker to use Gunicorn instead of Flask development server for production deployment. Updated SocketIO configuration for gevent compatibility.
This commit is contained in:
5
run.py
5
run.py
@@ -15,8 +15,11 @@ if __name__ == '__main__':
|
||||
debug_mode = config_name == 'development'
|
||||
port = int(os.getenv('PORT', 5000)) # Use PORT env var or default to 5000
|
||||
|
||||
# For production deployment, allow unsafe werkzeug or use a proper WSGI server
|
||||
# For production deployment with Gunicorn, SocketIO will be handled by Gunicorn
|
||||
# For development, we use SocketIO's built-in server
|
||||
if config_name == 'production':
|
||||
# In production, Gunicorn will handle the server
|
||||
# This is just a fallback
|
||||
socketio.run(app, debug=False, host='0.0.0.0', port=port, allow_unsafe_werkzeug=True)
|
||||
else:
|
||||
socketio.run(app, debug=debug_mode, host='0.0.0.0', port=port)
|
Reference in New Issue
Block a user