File size: 2,032 Bytes
793e953
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# ============================================================
# VetCopilot-LCPS 联合部署 — Docker Compose
# ============================================================
# 启动:
#   docker compose -f docker-compose.lcps.yml up -d
#
# 架构:
#   lcps-server (:8000) — Qwen 3B 本地推理
#   vetcopilot (:8080)   — FastAPI 后端 + React 前端
# ============================================================

services:
  # ---- LCPS 推理服务 ----
  lcps-server:
    build:
      context: ../../clinicease4vet
      dockerfile: Dockerfile
    image: vetnet-lcps:latest
    container_name: lcps-server
    restart: unless-stopped
    ports:
      - "8000:8000"
    volumes:
      # 模型文件必须提前下载到此路径
      - ./model/vet-qwen3b-v2-f16.gguf:/app/model/vet-qwen3b-v2-f16.gguf:ro
    environment:
      - PYTHONUNBUFFERED=1
    healthcheck:
      test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 180s
    deploy:
      resources:
        limits:
          memory: 6G
          cpus: "4"

  # ---- VetCopilot 后端 ----
  vetcopilot-backend:
    build:
      context: ../vetcopilot-backend
      dockerfile: ../deploy/Dockerfile.backend
    container_name: vetcopilot-backend
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      - LCPS_API_BASE=http://lcps-server:8000
      - LCPS_TIMEOUT=300
      - HOST=0.0.0.0
      - PORT=8080
    depends_on:
      lcps-server:
        condition: service_healthy
    volumes:
      - vetcopilot_data:/app/data

  # ---- Nginx (前端 + 反向代理) ----
  nginx:
    image: nginx:alpine
    container_name: vetcopilot-nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./nginx-site.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on:
      - vetcopilot-backend

volumes:
  vetcopilot_data: