Switch production deployment from Docker to PM2 on Ubuntu.

Add Express gateway, ecosystem config, and one-click install with native PostgreSQL, Node, and Python venv on port 23566.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-28 11:52:20 +08:00
parent e329d3398a
commit e797d188ee
20 changed files with 1578 additions and 714 deletions
+7 -10
View File
@@ -1,23 +1,20 @@
# 复制为 .env 后修改(一键部署脚本会自动生成)
# 部署目录默认:/opt/secondary-school-grade-archive
# Web 对外端口(默认 23566
WEB_PORT=23566
API_PORT=8000
API_TARGET=http://127.0.0.1:8000
# 生产环境务必修改
SECRET_KEY=请替换为随机字符串
POSTGRES_USER=postgres
POSTGRES_USER=gradeapp
POSTGRES_PASSWORD=请替换为强密码
POSTGRES_DB=student_archive
DATABASE_URL=postgresql://gradeapp:请替换为强密码@127.0.0.1:5432/student_archive
UPLOAD_DIR=/opt/secondary-school-grade-archive/uploads
# 允许跨域的前端地址(部署完成后改为实际访问地址)
# 若通过反向代理访问,请自行在反向代理层处理,此处填写直连地址即可
CORS_ORIGINS=http://127.0.0.1:23566,http://localhost:23566
# Ollama(错题 AI 解法,可选)
# Docker 容器内通过 host.docker.internal 访问宿主机 Ollama
OLLAMA_BASE_URL=http://host.docker.internal:11434
OLLAMA_BASE_URL=http://127.0.0.1:11434
OLLAMA_MODEL=qwen2.5:7b
# 成绩波动高亮阈值(0.08 = 8%)
FLUCTUATION_THRESHOLD=0.08