Repository navigation
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
172 lines (162 loc) · 4.42 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
172 lines (162 loc) · 4.42 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# ============================================================
# Virtual Path MES - 后端服务开发/生产编排
# 与 docker-compose.yml(基础设施)叠加使用:
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d --build
# 生产再加 -f docker-compose.prod.yml
# ============================================================
x-common-env: &common-env
SPRING_PROFILES_ACTIVE: docker
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_USERNAME: root
MYSQL_PASSWORD: ${MYSQL_ROOT_PASSWORD:-123455}
# 与 application.yml 的 ${REDIS_HOST:localhost} 对应(勿用 SPRING_REDIS_HOST)
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET:-MesDevOnlyJwtSecret-ChangeMe-InProd-2026}
services:
influxdb:
image: influxdb:2.7-alpine
container_name: mes-influxdb
restart: always
ports:
- "8086:8086"
environment:
DOCKER_INFLUXDB_INIT_MODE: setup
DOCKER_INFLUXDB_INIT_USERNAME: admin
DOCKER_INFLUXDB_INIT_PASSWORD: ${INFLUXDB_ADMIN_PASSWORD:-123455}
DOCKER_INFLUXDB_INIT_ORG: mes
DOCKER_INFLUXDB_INIT_BUCKET: mes_metrics
# 固定 token,与 mes-dashboard 的 INFLUXDB_TOKEN 保持一致(容器重建后不变)
DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: ${INFLUXDB_TOKEN:-kUVlFGXR2YxkzRUzn9bW9dJazYkigOU6GyYlKLdGsF7ekBLLz9URVnOLMmFZViLy}
healthcheck:
test: ["CMD-SHELL", "influx ping >/dev/null 2>&1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 20s
volumes:
- influxdb-data:/var/lib/influxdb2
networks:
- mes-network
mes-auth:
build:
context: ./mes-auth
dockerfile: Dockerfile
container_name: mes-auth
restart: always
ports:
- "8081:8081"
environment:
<<: *common-env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- mes-network
mes-gateway:
build:
context: ./mes-gateway
dockerfile: Dockerfile
container_name: mes-gateway
restart: always
ports:
- "9090:9090"
environment:
SPRING_PROFILES_ACTIVE: docker
MES_AUTH_URI: http://mes-auth:8081
MES_WORKORDER_URI: http://mes-workorder:8082
MES_PROCESS_URI: http://mes-process:8083
MES_QUALITY_URI: http://mes-quality:8084
MES_DASHBOARD_URI: http://mes-dashboard:8085
MES_DASHBOARD_WS_URI: ws://mes-dashboard:8085
MES_AI_URI: http://mes-ai-service:8087
JWT_SECRET: ${JWT_SECRET:-MesDevOnlyJwtSecret-ChangeMe-InProd-2026}
depends_on:
mes-auth:
condition: service_started
networks:
- mes-network
mes-workorder:
build:
context: ./mes-workorder
dockerfile: Dockerfile
container_name: mes-workorder
restart: always
ports:
- "8082:8082"
environment:
<<: *common-env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- mes-network
mes-process:
build:
context: ./mes-process
dockerfile: Dockerfile
container_name: mes-process
restart: always
ports:
- "8083:8083"
environment:
<<: *common-env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- mes-network
mes-quality:
build:
context: ./mes-quality
dockerfile: Dockerfile
container_name: mes-quality
restart: always
ports:
- "8084:8084"
environment:
<<: *common-env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
- mes-network
mes-dashboard:
build:
context: ./mes-dashboard
dockerfile: Dockerfile
container_name: mes-dashboard
restart: always
ports:
- "8085:8085"
environment:
<<: *common-env
# 与 application.yml 的 ${KAFKA_BOOTSTRAP_SERVERS:localhost:9092} 对应
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
INFLUXDB_URL: http://influxdb:8086
INFLUXDB_TOKEN: ${INFLUXDB_TOKEN:-kUVlFGXR2YxkzRUzn9bW9dJazYkigOU6GyYlKLdGsF7ekBLLz9URVnOLMmFZViLy}
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
influxdb:
condition: service_healthy
networks:
- mes-network
volumes:
influxdb-data:
networks:
mes-network:
driver: bridge