From e7f1f1b5cf4d97fde590771dd4173c698177aa6c Mon Sep 17 00:00:00 2001 From: taited Date: Thu, 9 Nov 2023 13:29:41 +0800 Subject: [PATCH] config gunicorn conf --- .gitignore | 1 + gunicorn_conf.py | 24 ++++++++++++++++++++++++ templates/game.html | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 gunicorn_conf.py diff --git a/.gitignore b/.gitignore index 1aab65a..0950c73 100644 --- a/.gitignore +++ b/.gitignore @@ -164,4 +164,5 @@ cython_debug/ *.pem *.idea .vscode +logs test_*.py diff --git a/gunicorn_conf.py b/gunicorn_conf.py new file mode 100644 index 0000000..7223749 --- /dev/null +++ b/gunicorn_conf.py @@ -0,0 +1,24 @@ +import os +import os.path as osp +from pathlib import Path + +current_file_path = Path(__file__).resolve() +current_dir_path = current_file_path.parent + +# SSL +keyfile = 'key.pem' +certfile = 'cert.pem' + +# Socket Path +bind = 'unix:' + osp.join(current_dir_path, 'gunicorn.sock') + +# Worker Options +workers = 2 +worker_class = 'uvicorn.workers.UvicornWorker' + +# Logging Options +loglevel = 'debug' +log_dir = osp.join(current_dir_path, 'logs') +os.makedirs(log_dir, exist_ok=True) +accesslog = osp.join(log_dir, 'access.log') +errorlog = osp.join(log_dir, 'error.log') diff --git a/templates/game.html b/templates/game.html index 63f34a3..f904ba7 100644 --- a/templates/game.html +++ b/templates/game.html @@ -59,7 +59,7 @@