f20de12fa2
图标: - 添加白色圆角矩形底板,占画布 80%(四周留透明呼吸边距) - M 内容占底板 65%,裁剪透明边距后居中 - 底板微妙渐变(#FAFAFA → #F0F0F0) - 清理原始图标幽灵半透明像素 - 全平台图标重新生成(PNG / ICNS / ICO / Android / iOS) 运维: - docker-compose.prod.yml & test.yml 添加 json-file 日志轮转 max-size: 100m, max-file: 5 - scripts/admin-ops.sql: 新增用户、积分赠送、积分补偿、批量补偿 - scripts/generate-rounded-icon.py: 可复用的图标生成脚本 其他: - prompts 文件重命名为语义化文件名 - .gitignore 移除 binaries/ 忽略(FFmpeg sidecar 需提交)
88 lines
3.0 KiB
YAML
88 lines
3.0 KiB
YAML
# =============================================================================
|
|
# 美家卡智影 API - 生产环境配置
|
|
# =============================================================================
|
|
# 说明:
|
|
# • 此配置仅运行 api + scheduler 服务
|
|
# • 假设 PostgreSQL 和 Redis 由外部基础设施提供(云数据库 / 自建集群)
|
|
# • 与测试环境使用**同一套 Dockerfile**,仅环境变量不同
|
|
#
|
|
# 用法:
|
|
# export $(cat .env | xargs) # 或从 CI/CD / 密钥管理注入
|
|
# docker compose -f docker-compose.prod.yml up -d --build
|
|
# =============================================================================
|
|
|
|
services:
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: meijiaka-zy-api
|
|
environment:
|
|
- ENV=production
|
|
- APP_BASE_URL=https://tapi.meijiaka.cn
|
|
- DEBUG=false
|
|
- LOG_LEVEL=INFO
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- REDIS_HOST=${REDIS_HOST}
|
|
- REDIS_PORT=${REDIS_PORT:-6379}
|
|
- REDIS_DB=${REDIS_DB:-0}
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- VOLCENGINE_API_KEY=${VOLCENGINE_API_KEY}
|
|
- VIDU_API_KEY=${VIDU_API_KEY}
|
|
- QINIU_ACCESS_KEY=${QINIU_ACCESS_KEY}
|
|
- QINIU_SECRET_KEY=${QINIU_SECRET_KEY}
|
|
volumes:
|
|
# 仅持久化日志到宿主机,其他数据走对象存储
|
|
- /opt/meijiaka-zy/logs:/root/Documents/Meijiaka-zy/logs
|
|
command: alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
ports:
|
|
- "8000:8000"
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "5"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')\""]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
scheduler:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: meijiaka-zy-scheduler
|
|
environment:
|
|
- ENV=production
|
|
- APP_BASE_URL=https://tapi.meijiaka.cn
|
|
- DEBUG=false
|
|
- LOG_LEVEL=INFO
|
|
- DATABASE_URL=${DATABASE_URL}
|
|
- REDIS_HOST=${REDIS_HOST}
|
|
- REDIS_PORT=${REDIS_PORT:-6379}
|
|
- REDIS_DB=${REDIS_DB:-0}
|
|
- SECRET_KEY=${SECRET_KEY}
|
|
- VOLCENGINE_API_KEY=${VOLCENGINE_API_KEY}
|
|
- VIDU_API_KEY=${VIDU_API_KEY}
|
|
volumes:
|
|
- /opt/meijiaka-zy/logs:/root/Documents/Meijiaka-zy/logs
|
|
command: python -m app.scheduler.main
|
|
restart: unless-stopped
|
|
logging:
|
|
driver: "json-file"
|
|
options:
|
|
max-size: "100m"
|
|
max-file: "5"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "python -c \"import asyncio, time; from app.core.redis_client import get_redis_client; r=get_redis_client(); t=asyncio.run(r.get('scheduler:heartbeat')); t=float(t) if t else 0; assert t>0 and time.time()-t<30, 'scheduler heartbeat stale'\""]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 30s
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|