refactor: simplify deployment - unified env and startup script
- Remove Docker deployment files (1panel doesn't use Docker) - Unify .env files: .env.example -> .env (single config file) - Merge start.sh and start-prod.sh into unified start.sh with --prod flag - Update setup_dev_env.sh to use .env instead of .env.local - Add DEPLOY.md with 1panel deployment guide 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
64
.env.example
64
.env.example
@@ -1,69 +1,35 @@
|
||||
# Tool_OCR - Environment Configuration Template
|
||||
# Copy this file to .env.local and fill in your actual values
|
||||
#
|
||||
# Note: Most path configurations have sensible defaults in config.py
|
||||
# Only override if you need custom paths
|
||||
# Tool_OCR - 環境變數配置
|
||||
# 複製此檔案為 .env 並填入實際值
|
||||
# cp .env.example .env
|
||||
|
||||
# ===== Database Configuration (Required) =====
|
||||
# ===== 資料庫 =====
|
||||
MYSQL_HOST=your-mysql-host
|
||||
MYSQL_PORT=3306
|
||||
MYSQL_USER=your-username
|
||||
MYSQL_PASSWORD=your-password
|
||||
MYSQL_DATABASE=your-database
|
||||
|
||||
# ===== Application Configuration =====
|
||||
# Server ports
|
||||
BACKEND_HOST=0.0.0.0
|
||||
# ===== 服務端口 =====
|
||||
# IT 會指派實際端口
|
||||
BACKEND_PORT=8000
|
||||
FRONTEND_HOST=0.0.0.0
|
||||
FRONTEND_PORT=5173
|
||||
|
||||
# Security (generate a random string for production: openssl rand -hex 32)
|
||||
SECRET_KEY=your-secret-key-here-please-change-this-to-random-string
|
||||
ALGORITHM=HS256
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES=1440
|
||||
# ===== 安全性 =====
|
||||
# 生產環境請使用: openssl rand -hex 32
|
||||
SECRET_KEY=your-secret-key-change-this
|
||||
|
||||
# ===== External Authentication Configuration (Required) =====
|
||||
# ===== 外部認證 =====
|
||||
EXTERNAL_AUTH_API_URL=https://your-auth-api.example.com
|
||||
EXTERNAL_AUTH_ENDPOINT=/api/auth/login
|
||||
EXTERNAL_AUTH_TIMEOUT=30
|
||||
TOKEN_REFRESH_BUFFER=300
|
||||
|
||||
# ===== Task Management Configuration =====
|
||||
DATABASE_TABLE_PREFIX=tool_ocr_
|
||||
ENABLE_TASK_HISTORY=true
|
||||
TASK_RETENTION_DAYS=30
|
||||
MAX_TASKS_PER_USER=1000
|
||||
|
||||
# ===== OCR Configuration =====
|
||||
# Note: PaddleOCR/PaddleX models are stored in ~/.paddleocr/ and ~/.paddlex/ by default
|
||||
OCR_LANGUAGES=ch,en,japan,korean
|
||||
OCR_CONFIDENCE_THRESHOLD=0.5
|
||||
MAX_OCR_WORKERS=4
|
||||
|
||||
# GPU Acceleration Configuration
|
||||
FORCE_CPU_MODE=false
|
||||
GPU_MEMORY_FRACTION=0.8
|
||||
GPU_DEVICE_ID=0
|
||||
|
||||
# ===== File Upload Configuration =====
|
||||
MAX_UPLOAD_SIZE=52428800
|
||||
ALLOWED_EXTENSIONS=png,jpg,jpeg,pdf,bmp,tiff,doc,docx,ppt,pptx
|
||||
# Path defaults to backend/uploads - only override if needed
|
||||
# UPLOAD_DIR=./uploads
|
||||
|
||||
# ===== Translation Configuration (DIFY API) =====
|
||||
# ===== 翻譯 API (DIFY) =====
|
||||
ENABLE_TRANSLATION=true
|
||||
DIFY_BASE_URL=https://your-dify-instance.example.com/v1
|
||||
DIFY_API_KEY=your-dify-api-key
|
||||
DIFY_TIMEOUT=120.0
|
||||
DIFY_MAX_RETRIES=3
|
||||
DIFY_MAX_BATCH_CHARS=5000
|
||||
DIFY_MAX_BATCH_ITEMS=20
|
||||
|
||||
# ===== CORS Configuration =====
|
||||
CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
|
||||
# ===== CORS =====
|
||||
# 根據實際部署的前端 URL 設定
|
||||
CORS_ORIGINS=http://localhost:5173
|
||||
|
||||
# ===== Logging Configuration =====
|
||||
# ===== 日誌 =====
|
||||
LOG_LEVEL=INFO
|
||||
# LOG_FILE defaults to backend/logs/app.log
|
||||
|
||||
Reference in New Issue
Block a user