chore: 将后端移动到 api/ 目录,准备合并为单仓库

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Opus 5.5 committed 2026-10-26 16:01:25 +08:00
1 parent e172ffc0b3
commit 0591eda56f
244 files changed

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
# 等待数据库就绪
echo "Waiting for database..."
sleep 5
# 执行数据库迁移
echo "Running database migrations..."
python manage.py migrate --noinput
# 收集静态文件
echo "Collecting static files..."
python manage.py collectstatic --noinput
# 计算worker数量 (CPU核心数 * 2 + 1)
WORKERS=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count() * 2 + 1)')
# 启动 Gunicorn
echo "Starting Gunicorn with $WORKERS workers..."
exec gunicorn api.asgi:application \
--bind 0.0.0.0:8000 \
--worker-class uvicorn.workers.UvicornWorker \
--workers $WORKERS \
--threads 2 \
--timeout 120 \
--max-requests 1000 \
--max-requests-jitter 50 \
--keep-alive 5 \
--log-level error \
--capture-output \
--enable-stdio-inheritance