This repository has been archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
176 lines (163 loc) · 3.54 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
version: "3.3"
services:
# 应用网关
service-gateway:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICES: core/gateway
PORT: 3000
depends_on:
- mongo
- redis
labels:
- "traefik.enable=true"
- "traefik.http.routers.api-gw.rule=PathPrefix(`/`)"
- "traefik.http.services.api-gw.loadbalancer.server.port=3000"
networks:
- internal
# 用户服务
service-user:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICES: core/user/*
depends_on:
- mongo
- redis
networks:
- internal
# 群组服务
service-group:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICES: core/group/*
depends_on:
- mongo
- redis
networks:
- internal
# 聊天服务
service-chat:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICES: core/chat/*
depends_on:
- mongo
- redis
networks:
- internal
# 文件服务 / 插件注册中心 / 配置服务
service-file:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICES: core/file,core/plugin/registry,core/config
depends_on:
- mongo
- redis
- minio
networks:
- internal
service-openapi:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICES: openapi/app,openapi/oidc/oidc
OPENAPI_PORT: 3003
OPENAPI_UNDER_PROXY: "true"
depends_on:
- mongo
- redis
- minio
labels:
- "traefik.enable=true"
- "traefik.http.routers.openapi-oidc.rule=PathPrefix(`/open`)"
- "traefik.http.services.openapi-oidc.loadbalancer.server.port=3003"
networks:
- internal
# 插件服务(所有插件)
service-all-plugins:
build:
context: .
image: tailchat-server
restart: unless-stopped
env_file: docker-compose.env
environment:
SERVICEDIR: plugins
depends_on:
- mongo
- redis
- minio
networks:
- internal
# 数据库
mongo:
image: mongo:4
restart: on-failure
volumes:
- data:/data/db
networks:
- internal
# 数据缓存与中转通讯
redis:
image: redis:alpine
restart: on-failure
networks:
- internal
# 存储服务
minio:
image: minio/minio
restart: on-failure
networks:
- internal
environment:
MINIO_ROOT_USER: tailchat
MINIO_ROOT_PASSWORD: com.msgbyte.tailchat
volumes:
- storage:/data
command: minio server /data --console-address ":9001"
# 路由转发
traefik:
image: traefik:v2.1
restart: unless-stopped
command:
- "--api.insecure=true" # Don't do that in production!
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entryPoints.web.address=:80"
- "--entryPoints.web.forwardedHeaders.insecure" # Not good
ports:
- 11000:80
- 127.0.0.1:11001:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- internal
- default
networks:
internal:
name: tailchat-internal
volumes:
data:
storage: