This commit is contained in:
2025-03-17 09:41:15 +08:00
parent 0d07daa655
commit 5c5b31db87
5 changed files with 70 additions and 5 deletions

View File

@@ -1,5 +1,19 @@
#!/bin/sh
python manage.py createcachetable
# 等待 Redis 和 PgBouncer 准备就绪
sleep 5
# 执行数据库迁移
python manage.py migrate --noinput
exec gunicorn --bind 0.0.0.0:8000 api.asgi:application -k uvicorn.workers.UvicornWorker -w 5
# 启动 Gunicorn
exec gunicorn api.asgi:application \
--bind 0.0.0.0:8000 \
--worker-class uvicorn.workers.UvicornWorker \
--workers 4 \
--threads 2 \
--timeout 120 \
--keep-alive 65 \
--max-requests 1000 \
--max-requests-jitter 50 \
--log-level info