增加gunicorn启动脚本

This commit is contained in:
mkg
2021-10-28 10:00:21 +08:00
parent 7eb41e9754
commit 27ed99ee27
2 changed files with 21 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
import os
import multiprocessing
bind = '0.0.0.0:8000'
backlog = 512
chdir = os.path.dirname(os.path.abspath(__file__))
timeout = 30
worker_class = 'sync'
workers = multiprocessing.cpu_count() * 2 + 1
threads = 2
loglevel = 'info'
access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"'
if not os.path.exists('logs'):
os.mkdir('logs')
accesslog = os.path.join(chdir, "logs/gunicorn_access.log")
errorlog = os.path.join(chdir, "logs/gunicorn_error.log")
+2
View File
@@ -0,0 +1,2 @@
source venv/bin/activate
exec gunicorn -c gunicorn.conf.py "applications:create_app('development')"