Repository navigation
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
61 lines (58 loc) · 1.86 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
61 lines (58 loc) · 1.86 KB
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
# ============================================================
# Virtual Path MES - 生产部署补充编排
# 在基础设施(docker-compose.yml) + 后端(docker-compose.dev.yml)之上,
# 补充 mes-frontend 与 mes-ai-service 两个应用服务。
#
# 使用:docker compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.prod.yml up -d --build
# ============================================================
services:
# ---------- AI 服务 ----------
mes-ai-service:
build:
context: ./mes-ai-service
dockerfile: Dockerfile
container_name: mes-ai-service
restart: always
ports:
- "8087:8087"
environment:
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_USERNAME: root
MYSQL_PASSWORD: ${MYSQL_ROOT_PASSWORD:-123455}
MYSQL_DATABASE: mes_db
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET:-}
ZHIPU_API_KEY: ${ZHIPU_API_KEY:-}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8087/api/v1/health', timeout=3)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- mes-network
# ---------- 前端(nginx 托管静态资源 + 代理 /api → 网关)----------
mes-frontend:
build:
context: ./mes-frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: /api
# 相对 /ai(与 baseURL /api 拼接为 /api/ai/**;写 /api/ai 会双重前缀)
VITE_AI_SERVICE_URL: /ai
container_name: mes-frontend
restart: always
ports:
- "3000:3000"
depends_on:
- mes-gateway
networks:
- mes-network
# 网络由 docker-compose.yml 定义(driver: bridge),此处仅引用