feat: production branch with deploy config for baota panel

- Add deploy/ directory with production env, supervisor, nginx, migration configs
- Include all latest features: admin management, feedback, footer with ICP/beian
- Database: foreign_trade (PostgreSQL), user: foreign_trade
- Frontend: trade.yuzhiran.com, backend proxy via Nginx
This commit is contained in:
TradeMate Dev
2026-05-14 09:19:30 +08:00
parent 23a31f7c00
commit 5a1af9f82f
15 changed files with 1377 additions and 71 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# 生产数据库迁移脚本
# 使用方式: bash deploy/database/migrate.sh
# 注意:需先在 backend/ 目录下配置好 .env 或设置好环境变量
set -e
cd "$(dirname "$0")/../../backend"
# 检查 .env 是否存在
if [ ! -f ".env" ]; then
echo "❌ 未找到 .env 文件,请先复制 deploy/backend/.env.production 到 backend/.env"
echo " cp deploy/backend/.env.production backend/.env"
echo " 然后编辑 .env 填入 SECRET_KEY 和 AI API Key"
exit 1
fi
echo "🔧 激活虚拟环境..."
if [ -d "venv" ]; then
source venv/bin/activate
fi
echo "📦 安装/更新依赖..."
pip install -r requirements.txt -q
echo "🗄️ 运行数据库迁移..."
alembic upgrade head
echo "✅ 迁移完成"