Files
Document_translator_1panel/INSTALL.txt
beabigegg 6599716481 1panel
2025-10-03 08:19:40 +08:00

66 lines
2.6 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

===============================================================================
PANJIT Document Translator V2 - 1Panel 部署快速指南
===============================================================================
架構說明:
- Web 服務Gunicorn + Flask (直接對外,無 Nginx)
- 任務隊列Redis + Celery Worker/Beat
- 資料庫MySQL (外部服務)
===============================================================================
📋 部署步驟:
1. 執行安裝腳本
chmod +x install.sh
./install.sh
2. 修改環境變數中的安全金鑰和端口
nano .env
# 必須修改:
# SECRET_KEY=your-production-secret-key-change-this
# JWT_SECRET_KEY=your-production-jwt-secret-change-this
# 可選修改:
# PORT=12010 (建議範圍 12010-12019
3. 安裝 Redis
sudo apt install redis-server
sudo systemctl start redis
redis-cli ping # 確認返回 PONG
4. 在 1Panel 介面配置
- 命令執行: python3 start.py
- 端口映射: 12010 (或您在 .env 中設定的 PORT 值)
5. 啟動並驗證
curl http://localhost:12010/api/health
===============================================================================
🔌 使用端口清單:
┌─────────────────┬──────────┬──────────────────────┐
│ 服務 │ 端口 │ 可否修改 │
├─────────────────┼──────────┼──────────────────────┤
│ Flask Web 服務 │ 12010 │ ✅ 可修改 (12010-12019) │
│ Redis │ 6379 │ ⚠️ 不建議修改 │
│ MySQL (外部) │ 33306 │ ❌ 不可修改 │
│ LDAP (外部) │ 389 │ ❌ 不可修改 │
│ SMTP (外部) │ 25 │ ❌ 不可修改 │
└─────────────────┴──────────┴──────────────────────┘
✅ 已配置項目:
- 資料庫: mysql.theaken.com:33306 (db_A060)
- LDAP: panjit.com.tw:389
- SMTP: mail.panjit.com.tw:25
- Dify API: 翻譯 + OCR (已配置在 api.txt)
- Web 端口: 12010 (可在 .env 中修改)
⚠️ 注意事項:
- Redis 必須安裝並運行在端口 6379
- 確保 .env 中的 PORT 與 1Panel 端口映射一致
- Python 版本需 3.10+
📚 詳細說明請參考 README.md
===============================================================================