baseline: 批次A-D 成果 + membership 半成品(测试红)

This commit is contained in:
agent
2026-09-11 23:11:35 +08:00
commit b3f3095d53
311 changed files with 40540 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# 开发环境启动脚本:SQLite + Granian + 自动重载
set -euo pipefail
# This script lives in backend/infra/scripts; manage.py lives in backend/.
SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
cd "$SCRIPT_DIR/../.."
export DJANGO_SETTINGS_MODULE=config.settings.dev
echo "[dealerhub-dev] Running migrations..."
python manage.py migrate --noinput
echo "[dealerhub-dev] Starting Granian ASGI on 0.0.0.0:8000..."
exec granian config.asgi:application \
--interface asgi \
--host 0.0.0.0 \
--port 8000 \
--reload \
--log-level info
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# 生产环境启动脚本:PostgreSQL + Granian (多 worker)
# WORKDIR in Dockerfile = /app
set -e
cd /app
export DJANGO_SETTINGS_MODULE=config.settings.prod
echo "[dealerhub-prod] Running migrations..."
python manage.py migrate --noinput
echo "[dealerhub-prod] Collecting static files..."
python manage.py collectstatic --noinput
WORKERS="${GRANIAN_WORKERS:-4}"
RUNTIME_THREADS="${GRANIAN_RUNTIME_THREADS:-1}"
echo "[dealerhub-prod] Starting Granian ASGI (workers=$WORKERS, runtime-threads=$RUNTIME_THREADS)..."
exec granian config.asgi:application \
--interface asgi \
--host 0.0.0.0 \
--port 8000 \
--workers "$WORKERS" \
--runtime-threads "$RUNTIME_THREADS" \
--log-level info