Files
meijiaka-zy/python-api/docker-compose.test.yml
T
小鱼开发 11a85bfee7 fix: 修复 BGM 本地上传、封面形象样式、ESLint 清零、access log 关闭
- BGM 本地上传改用 Tauri open 对话框,修复 path 为空导致混音失效
- Rust 端放宽 BGM 路径验证(系统文件选择器选取的文件),加路径遍历防护
- BGM 混音失败时 toast 提示,不再静默忽略
- 我的作品页增加导出功能
- 封面形象卡片样式统一为 works-card 体系
- 关闭 uvicorn access log(Dockerfile + 3 个 compose)
- ESLint 全绿:关掉 prop-types/incompatible-library,修复 curly/exhaustive-deps/any/unused-vars
- .gitignore 排除 *.exe 构建产物
2026-05-27 18:37:33 +08:00

120 lines
2.9 KiB
YAML

# 美家卡智影 - 测试服部署配置
# ==============================
# 用法:
# docker-compose -f docker-compose.test.yml up -d --build
#
# 包含: PostgreSQL + Redis + API + Scheduler
# 独立运行,不依赖外部网络或服务
services:
db:
image: postgres:15-alpine
container_name: meijiaka-zy-db
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: meijiaka_zy
volumes:
- /opt/meijiaka-zy/data/postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
networks:
- meijiaka-zy
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
redis:
image: redis:7-alpine
container_name: meijiaka-zy-redis
volumes:
- /opt/meijiaka-zy/data/redis:/data
ports:
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- meijiaka-zy
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
api:
build:
context: .
dockerfile: Dockerfile
container_name: meijiaka-zy-api
env_file: .env
environment:
TZ: Asia/Shanghai
LOG_LEVEL: INFO
ports:
- "8081:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: >
sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000 --no-access-log"
networks:
- meijiaka-zy
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/api/v1/system/health')\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
scheduler:
build:
context: .
dockerfile: Dockerfile
container_name: meijiaka-zy-scheduler
env_file: .env
environment:
TZ: Asia/Shanghai
LOG_LEVEL: INFO
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command: python -m app.scheduler.main
networks:
- meijiaka-zy
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
networks:
meijiaka-zy:
driver: bridge