Files
trade-assistant/docker-compose.yml
TradeMate Dev 5d2bced39f docs: update project docs and clean up redundant files
- PROGRESS.md: update to 2026-05-29 with security hardening (T-005),
  4-frontend architecture, AI provider refactoring, discovery features,
  landing page/referral/quota, desktop layout, admin AI management
- AGENTS.md: add AI provider list (Alibaba/NVIDIA, removed Claude/DeepL/Local),
  DB-driven config, CSRF/rate-limit/CORS notes, admin_ai reload quirk
- .env.example: sync with actual config, replace deprecated providers
  with current Sensenova/OpencodeGo/NVIDIA/Spark/Alibaba
- docs/PROJECT_STATUS.md: archive (fully superseded by PROGRESS.md)
- Remove generated JS files (_bing_search.js, _batch_search.js)
- Remove empty directories (data/corpus, data/models)
- Remove backend/.coverage (test artifact)
- Fix services/.gitignore to cover _bing_search.js
- Include pending AI provider DB admin feature (admin_ai, AIProvider model,
  AIProviders.vue, migration) and T-008 test report
2026-05-29 11:15:33 +08:00

206 lines
4.7 KiB
YAML

version: '3.8'
services:
# =====================
# 数据库服务
# =====================
postgres:
image: pgvector/pgvector:pg15
container_name: tradmate-postgres
environment:
POSTGRES_DB: tradmate
POSTGRES_USER: tradmate
POSTGRES_PASSWORD: ${DB_PASSWORD:-tradmate}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tradmate"]
interval: 5s
timeout: 5s
retries: 5
networks:
- tradmate-network
redis:
image: redis:7-alpine
container_name: tradmate-redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- tradmate-network
# =====================
# 后端服务
# =====================
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: tradmate-backend
env_file:
- ./backend/.env
environment:
- DATABASE_URL=postgresql+asyncpg://tradmate:tradmate@postgres:5432/tradmate
- REDIS_URL=redis://redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/2
ports:
- "8000:8000"
volumes:
- ./backend:/app
- uploads_data:/app/uploads
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
networks:
- tradmate-network
# =====================
# Celery 任务队列
# =====================
celery-worker:
build:
context: ./backend
dockerfile: Dockerfile
container_name: tradmate-celery-worker
env_file:
- ./backend/.env
environment:
- DATABASE_URL=postgresql+asyncpg://tradmate:tradmate@postgres:5432/tradmate
- REDIS_URL=redis://redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/1
- CELERY_RESULT_BACKEND=redis://redis:6379/2
volumes:
- ./backend:/app
depends_on:
- redis
- postgres
command: celery -A app.celery_app worker --loglevel=info --concurrency=4
networks:
- tradmate-network
celery-beat:
build:
context: ./backend
dockerfile: Dockerfile
container_name: tradmate-celery-beat
env_file:
- ./backend/.env
environment:
- DATABASE_URL=postgresql+asyncpg://tradmate:tradmate@postgres:5432/tradmate
- REDIS_URL=redis://redis:6379/0
- CELERY_BROKER_URL=redis://redis:6379/1
volumes:
- ./backend:/app
depends_on:
- redis
- postgres
command: celery -A app.celery_app beat --loglevel=info
networks:
- tradmate-network
# =====================
# 前端服务 - 管理后台
# =====================
admin-frontend:
build:
context: ./admin-frontend
dockerfile: Dockerfile
container_name: tradmate-admin
ports:
- "5173:5173"
volumes:
- ./admin-frontend:/app
- /app/node_modules
environment:
- VITE_API_BASE_URL=/api/v1
depends_on:
- backend
command: npm run dev -- --host 0.0.0.0
networks:
- tradmate-network
# =====================
# 前端服务 - 用户工作台
# =====================
user-frontend:
build:
context: ./user-frontend
dockerfile: Dockerfile
container_name: tradmate-user
ports:
- "5174:5174"
volumes:
- ./user-frontend:/app
- /app/node_modules
environment:
- VITE_API_BASE_URL=/api/v1
depends_on:
- backend
command: npm run dev -- --host 0.0.0.0
networks:
- tradmate-network
# =====================
# 前端服务 - 移动端 H5
# =====================
uni-app:
build:
context: ./uni-app
dockerfile: Dockerfile
container_name: tradmate-uniapp
ports:
- "3000:3000"
volumes:
- ./uni-app:/app
- /app/node_modules
environment:
- VITE_API_BASE_URL=/api/v1
depends_on:
- backend
command: npm run dev:h5 -- --host 0.0.0.0
networks:
- tradmate-network
# =====================
# Nginx 反向代理
# =====================
nginx:
image: nginx:alpine
container_name: tradmate-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- backend
- admin-frontend
- user-frontend
- uni-app
networks:
- tradmate-network
volumes:
postgres_data:
redis_data:
uploads_data:
networks:
tradmate-network:
driver: bridge