-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
232 lines (217 loc) · 4.59 KB
/
docker-compose.yml
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
#file: noinspection SpellCheckingInspection
version: '3.8'
# 网络配置
networks:
backend:
driver: ${NETWORKS_DRIVER}
# 服务容器配置
services:
mysql:
image: mysql
environment:
- TZ=${TZ}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} # 设置 Mysql root 用户密码
volumes:
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql # 引用 .env 配置中 DATA_PATH_HOST 变量,将宿主机上存放 Mysql 数据的目录挂载到容器中 /var/lib/mysql 目录
ports:
- "${MYSQL_PORT}:3306" # 设置容器3306端口映射指定宿主机端口
networks:
- backend
restart: always
redis:
image: redis
environment:
- TZ=${TZ}
volumes:
- ${DATA_PATH_HOST}/redis:/data # 引用 .env 配置中 DATA_PATH_HOST 变量,将宿主机上存放 Redis 数据的目录挂载到容器中 /data 目录
ports:
- "${REDIS_PORT}:6379" # 设置容器6379端口映射指定宿主机端口
networks:
- backend
restart: always
prometheus:
image: prom/prometheus
environment:
- TZ=${TZ}
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml # 将 prometheus 配置文件挂载到容器里
ports:
- "${PROMETHEUS_PORT}:9090" # 用于宿主机访问可视化web
networks:
- backend
restart: always
grafana:
image: grafana/grafana
environment:
- TZ=${TZ}
ports:
- "${GRAFANA_PORT}:3000" # 用于宿主机访问可视化web
networks:
- backend
restart: always
jaeger:
image: jaegertracing/all-in-one
environment:
- TZ=${TZ}
ports:
- "${JAEGER_PORT}:16686" # 用于宿主机访问可视化web
networks:
- backend
restart: always
minio:
image: minio/minio
command: server --console-address ":9090" -address ":9000" /data
environment:
- TZ=${TZ}
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
volumes:
- ${DATA_PATH_HOST}/minio/data:/data
- ${DATA_PATH_HOST}/minio/config:/root/.minio
ports:
- "${MINIO_CONSOLE_PORT}:9090" # 用于宿主机访问Minio Console
- "${MINIO_API_PORT}:9000" # 用于宿主机访问Minio Api
restart: always
networks:
- backend
consul:
image: consul:latest
environment:
- TZ=${TZ}
ports:
- "8500:8500"
networks:
- backend
restart: always
user:
build:
context: ./apps/user
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
publish:
build:
context: ./apps/publish
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
- minio
depends_on:
- mysql
- redis
- consul
- minio
networks:
- backend
restart: always
favorite:
build:
context: ./apps/favorite
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
feed:
build:
context: ./apps/feed
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
comment:
build:
context: ./apps/comment
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
relation:
build:
context: ./apps/relation
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
message:
build:
context: ./apps/message
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
gateway:
build:
context: ./apps/gateway
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
ports:
- "${GATEWAY_PORT}:8888"
restart: always