解决运行问题

main
wang 2 months ago
parent 81b3d08eda
commit 34b78f4aca

@ -34,5 +34,5 @@ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
# 暴露端口
EXPOSE 5000
# 启动命令
CMD ["python", "run_server.py"]
# Command to run the application using Gunicorn as a production server
CMD ["gunicorn", "--worker-class", "eventlet", "-w", "1", "--bind", "0.0.0.0:5000", "app:app"]

@ -42,7 +42,7 @@ CORS(app,
allow_headers=['Content-Type', 'Authorization', 'X-Requested-With']) # 允许所有源的凭证请求
db = SQLAlchemy(app)
socketio = SocketIO(app, cors_allowed_origins="*", engineio_logger=True)
socketio = SocketIO(app, cors_allowed_origins="*", engineio_logger=True, async_mode='threading')
# 跟踪所有活跃游戏会话
active_games = {} # 用户ID -> 游戏状态
@ -925,5 +925,5 @@ def test_admin_status():
if __name__ == '__main__':
# 在启动应用前初始化数据库
init_db()
# 使用 eventlet 或 gevent 来获得更好的性能
# 使用 threading 模式以获得更好的兼容性
socketio.run(app, debug=True, host='0.0.0.0', port=5000)

@ -8,4 +8,3 @@ pymysql==1.0.3
eventlet==0.33.3
gunicorn==20.1.0
python-dotenv==1.0.0
mysqlclient==2.1.1

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -3518,9 +3518,8 @@
},
"node_modules/axios": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.10.0.tgz",
"integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
@ -11552,9 +11551,8 @@
},
"node_modules/vue-router": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.1.tgz",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.1.tgz",
"integrity": "sha512-ogAF3P97NPm8fJsE4by9dwSYtDwXIY1nFY9T6DyQnGHd1E2Da94w9JIolpe42LJGIl0DwOHBi8TcRPlPGwbTtw==",
"license": "MIT",
"dependencies": {
"@vue/devtools-api": "^6.6.4"
},

@ -3538,9 +3538,8 @@
},
"node_modules/axios": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.10.0.tgz",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.10.0.tgz",
"integrity": "sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
"form-data": "^4.0.0",
@ -11587,9 +11586,8 @@
},
"node_modules/vue-router": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.5.1.tgz",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-4.5.1.tgz",
"integrity": "sha512-ogAF3P97NPm8fJsE4by9dwSYtDwXIY1nFY9T6DyQnGHd1E2Da94w9JIolpe42LJGIl0DwOHBi8TcRPlPGwbTtw==",
"license": "MIT",
"dependencies": {
"@vue/devtools-api": "^6.6.4"
},

Loading…
Cancel
Save