forked from openimsdk/open-im-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
196 lines (182 loc) · 5.53 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
#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git
version: "3"
services:
mysql:
image: mysql:5.7
ports:
- 13306:3306
- 23306:33060
container_name: mysql
volumes:
- ${DATA_DIR}/components/mysql/data:/var/lib/mysql
- /etc/localtime:/etc/localtime
environment:
MYSQL_ROOT_PASSWORD: ${PASSWORD}
restart: always
mongodb:
image: mongo:4.0
ports:
- 37017:27017
container_name: mongo
command: --wiredTigerCacheSizeGB 1 --auth
volumes:
- ${DATA_DIR}/components/mongodb/data/db:/data/db
- ${DATA_DIR}/components/mongodb/data/logs:/data/logs
- ${DATA_DIR}/components/mongodb/data/conf:/etc/mongo
- ./script/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
- MONGO_INITDB_ROOT_USERNAME=${USER}
- MONGO_INITDB_ROOT_PASSWORD=${PASSWORD}
- MONGO_INITDB_DATABASE=openIM
- MONGO_USERNAME=${USER}
- MONGO_PASSWORD=${PASSWORD}
#
restart: always
redis:
image: redis
ports:
- 16379:6379
container_name: redis
volumes:
- ${DATA_DIR}/components/redis/data:/data
#redis config file
- ${DATA_DIR}/components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
environment:
TZ: Asia/Shanghai
restart: always
sysctls:
net.core.somaxconn: 1024
command: redis-server --requirepass ${PASSWORD} --appendonly yes
zookeeper:
image: wurstmeister/zookeeper
ports:
- 2181:2181
container_name: zookeeper
volumes:
- /etc/localtime:/etc/localtime
environment:
TZ: Asia/Shanghai
restart: always
kafka:
image: wurstmeister/kafka
container_name: kafka
restart: always
ports:
- 9092:9092
environment:
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "ws2ms_chat:8:1,ms2ps_chat:8:1,msg_to_mongo:8:1"
KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9092,OUTSIDE://103.116.45.174:9092
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
depends_on:
- zookeeper
etcd:
image: quay.io/coreos/etcd
ports:
- 2379:2379
- 2380:2380
container_name: etcd
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
environment:
ETCDCTL_API: 3
restart: always
command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new
minio:
image: minio/minio
ports:
- 10005:9000
- 9090:9090
container_name: minio
volumes:
- /mnt/data:/data
- /mnt/config:/root/.minio
environment:
MINIO_ROOT_USER: ${USER}
MINIO_ROOT_PASSWORD: ${PASSWORD}
restart: always
command: minio server /data --console-address ':9090'
open_im_server:
image: openim/open_im_server:v2.3.5
container_name: open_im_server
volumes:
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
- ./config/usualConfig.yaml:/Open-IM-Server/config/usualConfig.yaml
- ${DATA_DIR}/db/sdk:/Open-IM-Server/db/sdk
- ./script:/Open-IM-Server/script
restart: always
depends_on:
- kafka
- mysql
- mongodb
- redis
- etcd
- minio
network_mode: "host"
logging:
driver: json-file
options:
max-size: "1g"
max-file: "2"
open_im_enterprise:
image: openim/open_im_enterprise:v1.0.0
container_name: open_im_enterprise
volumes:
- ./logs:/Open-IM-Enterprise/logs
- ./docker-compose_cfg/config.yaml:/Open-IM-Enterprise/config/config.yaml
restart: always
depends_on:
- mysql
- mongodb
- redis
- etcd
- minio
- open_im_server
network_mode: "host"
logging:
driver: json-file
options:
max-size: "1g"
max-file: "2"
environment:
CONFIG_NAME: "/Open-IM-Enterprise"
prometheus:
image: prom/prometheus
volumes:
- ./docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
container_name: prometheus
# ports:
# - 9091:9091
depends_on:
- open_im_server
command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
network_mode: "host"
grafana:
image: grafana/grafana
volumes:
# - ./grafana/dashboards/dashboard.json:/var/lib/grafana/dashboards/dashboard.json
# - ./grafana/provisioning/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
- ./docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
- ./docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json
container_name: grafana
# ports:
# - 10007:10007
depends_on:
- prometheus
network_mode: "host"
node-exporter:
image: quay.io/prometheus/node-exporter
container_name: node-exporter
restart: always
ports:
- "9100:9100"