- 升级 Anthropic API 配置支持自定义 base URL - 更新模型版本到 claude-sonnet-4-6 - 添加 QuestionResponse.user_id 字段 - 完善 docker-compose.yml 添加 backend 和 celery 服务 - 新增项目文档(API、部署、架构等) - 添加测试脚本和配置文件 Co-Authored-By: Claude Sonnet 4.6 (1M context) <[email protected]>
98 lines
2.3 KiB
YAML
98 lines
2.3 KiB
YAML
services:
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
ports:
|
|
- "8000:8000"
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://wrongbook:wrongbook@postgres:5432/wrongbook
|
|
REDIS_URL: redis://redis:6379/0
|
|
MINIO_ENDPOINT: minio:9000
|
|
MINIO_ACCESS_KEY: minioadmin
|
|
MINIO_SECRET_KEY: minioadmin
|
|
MINIO_BUCKET: wrongbook
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./backend:/app
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
|
|
|
|
celery:
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://wrongbook:wrongbook@postgres:5432/wrongbook
|
|
REDIS_URL: redis://redis:6379/0
|
|
MINIO_ENDPOINT: minio:9000
|
|
MINIO_ACCESS_KEY: minioadmin
|
|
MINIO_SECRET_KEY: minioadmin
|
|
MINIO_BUCKET: wrongbook
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./backend:/app
|
|
command: celery -A app.tasks.celery_app worker --loglevel=info
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
ports:
|
|
- "45432:5432"
|
|
environment:
|
|
POSTGRES_DB: wrongbook
|
|
POSTGRES_USER: wrongbook
|
|
POSTGRES_PASSWORD: wrongbook
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
- ./infra/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U wrongbook"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
postgres-test:
|
|
image: postgres:16-alpine
|
|
ports:
|
|
- "45433:5432"
|
|
environment:
|
|
POSTGRES_DB: wrongbook_test
|
|
POSTGRES_USER: wrongbook
|
|
POSTGRES_PASSWORD: wrongbook
|
|
tmpfs:
|
|
- /var/lib/postgresql/data
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
ports:
|
|
- "46379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
minio:
|
|
image: minio/minio
|
|
command: server /data --console-address ":9001"
|
|
ports:
|
|
- "49000:9000"
|
|
- "49001:9001"
|
|
environment:
|
|
MINIO_ROOT_USER: minioadmin
|
|
MINIO_ROOT_PASSWORD: minioadmin
|
|
volumes:
|
|
- miniodata:/data
|
|
|
|
volumes:
|
|
pgdata:
|
|
miniodata:
|
|
|