-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yaml
199 lines (186 loc) · 3.98 KB
/
docker-compose.yaml
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
version: '3.7'
networks:
backend:
driver: ${NETWORKS_DRIVER}
services:
consul:
image: consul:1.15.4
environment:
- TZ=${TZ}
ports:
- "8500:8500"
networks:
- backend
restart: always
mysql:
image: mysql
environment:
- TZ=${TZ}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} # 设置 Mysql root 用户密码
- MYSQL_DATABASE=${MYSQL_DATABASE} # 设置 Mysql 数据库名称
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
minio:
build:
context: ./internal/agent
command: server --console-address ":9090" -address ":9000" /data
environment:
- TZ=${TZ}
- MINIO_ROOT_USER=${MINIO_ACCESS_KEY}
- MINIO_ROOT_PASSWORD=${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
depends_on:
- rabbitmq
networks:
- backend
restart: always
rabbitmq:
image: rabbitmq:3.8.9-management
environment:
- TZ=${TZ}
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
ports:
- "${RABBITMQ_PORT}:5672"
- "${RABBITMQ_MANAGEMENT_PORT}:15672"
networks:
- backend
restart: always
user:
build:
context: ./internal/user
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
video:
build:
context: ./internal/video
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
- minio
depends_on:
- mysql
- redis
- consul
- minio
- rabbitmq
networks:
- backend
restart: always
favorite:
build:
context: ./internal/favorite
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
comment:
build:
context: ./internal/comment
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
relation:
build:
context: ./internal/relation
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
message:
build:
context: ./internal/message
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
restart: always
gateway:
build:
context: ./internal/gateway
environment:
- TZ=${TZ}
links:
- mysql
- redis
- consul
depends_on:
- mysql
- redis
- consul
networks:
- backend
ports:
- "${GATEWAY_PORT}:8888"
restart: always