feat: 添加 Docker 部署配置 + 安全加固 + 数据导出 API
- 新增 backend/Dockerfile + frontend/Dockerfile (多阶段构建) - 新增 docker-compose.yml (postgres + redis + backend + frontend) - 新增 .env.example 模板 (前后端) - 新增 export API: 任务数据导出 + 审计日志导出 (CSV + 流式响应) - 安全加固: CORS 从环境变量配置, 安全 headers 中间件 - 生产环境自动禁用 API 文档 (Swagger/Redoc) - 添加 ENVIRONMENT, CORS_ORIGINS 配置项 - 前端启用 Next.js standalone 输出模式 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
e0bd3f2911
commit
86a7865808
+29
-8
@@ -1,21 +1,42 @@
|
||||
# 应用配置
|
||||
# ===========================
|
||||
# 秒思智能审核平台 - 后端环境变量
|
||||
# ===========================
|
||||
# 复制此文件为 .env 并填入实际值
|
||||
# cp .env.example .env
|
||||
|
||||
# --- 应用 ---
|
||||
APP_NAME=秒思智能审核平台
|
||||
APP_VERSION=1.0.0
|
||||
DEBUG=false
|
||||
|
||||
# 数据库
|
||||
# --- 数据库 ---
|
||||
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/miaosi
|
||||
|
||||
# Redis
|
||||
# --- Redis ---
|
||||
REDIS_URL=redis://localhost:6379/0
|
||||
|
||||
# JWT 密钥 (生产环境必须更换)
|
||||
# --- JWT ---
|
||||
# 生产环境务必更换为随机密钥: python -c "import secrets; print(secrets.token_urlsafe(64))"
|
||||
SECRET_KEY=your-secret-key-change-in-production
|
||||
ALGORITHM=HS256
|
||||
ACCESS_TOKEN_EXPIRE_MINUTES=30
|
||||
|
||||
# AI 配置 (可选,也可通过 API 配置)
|
||||
AI_PROVIDER=doubao
|
||||
# --- AI 服务 (中转服务商) ---
|
||||
AI_PROVIDER=oneapi
|
||||
AI_API_KEY=
|
||||
AI_API_BASE_URL=
|
||||
|
||||
# 加密密钥 (生产环境必须更换,用于加密 API Key)
|
||||
ENCRYPTION_KEY=your-32-byte-encryption-key-here
|
||||
# --- 阿里云 OSS ---
|
||||
OSS_ACCESS_KEY_ID=
|
||||
OSS_ACCESS_KEY_SECRET=
|
||||
OSS_ENDPOINT=oss-cn-hangzhou.aliyuncs.com
|
||||
OSS_BUCKET_NAME=miaosi-files
|
||||
OSS_BUCKET_DOMAIN=
|
||||
|
||||
# --- 加密密钥 ---
|
||||
# 用于加密存储 API 密钥等敏感数据
|
||||
# 生成方法: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
|
||||
ENCRYPTION_KEY=
|
||||
|
||||
# --- 文件上传 ---
|
||||
MAX_FILE_SIZE_MB=500
|
||||
|
||||
Reference in New Issue
Block a user