2023-06-29 22:35:31 +08:00
|
|
|
|
#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git
|
2023-06-30 17:52:55 +08:00
|
|
|
|
version: "3"
|
2023-06-29 22:35:31 +08:00
|
|
|
|
services:
|
|
|
|
|
mysql:
|
|
|
|
|
image: mysql:5.7
|
|
|
|
|
ports:
|
|
|
|
|
- 13306:3306
|
|
|
|
|
- 23306:33060
|
|
|
|
|
container_name: mysql
|
|
|
|
|
volumes:
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- ${DATA_DIR}/components/mysql/data:/var/lib/mysql
|
2023-06-29 22:35:31 +08:00
|
|
|
|
- /etc/localtime:/etc/localtime
|
|
|
|
|
environment:
|
2023-06-30 17:52:55 +08:00
|
|
|
|
MYSQL_ROOT_PASSWORD: ${PASSWORD}
|
2023-06-29 22:35:31 +08:00
|
|
|
|
restart: always
|
|
|
|
|
|
|
|
|
|
mongodb:
|
2023-07-06 10:58:07 +08:00
|
|
|
|
image: mongo:6.0.2
|
2023-06-29 22:35:31 +08:00
|
|
|
|
ports:
|
|
|
|
|
- 37017:27017
|
|
|
|
|
container_name: mongo
|
2022-06-27 13:20:31 +08:00
|
|
|
|
command: --wiredTigerCacheSizeGB 1 --auth
|
2023-06-29 22:35:31 +08:00
|
|
|
|
volumes:
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- ${DATA_DIR}/components/mongodb/data/db:/data/db
|
|
|
|
|
- ${DATA_DIR}/components/mongodb/data/logs:/data/logs
|
|
|
|
|
- ${DATA_DIR}/components/mongodb/data/conf:/etc/mongo
|
2023-07-06 10:58:07 +08:00
|
|
|
|
- ./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
|
2023-06-29 22:35:31 +08:00
|
|
|
|
environment:
|
|
|
|
|
- TZ=Asia/Shanghai
|
|
|
|
|
# cache
|
|
|
|
|
- wiredTigerCacheSizeGB=1
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- MONGO_INITDB_ROOT_USERNAME=${USER}
|
|
|
|
|
- MONGO_INITDB_ROOT_PASSWORD=${PASSWORD}
|
|
|
|
|
- MONGO_INITDB_DATABASE=openIM
|
|
|
|
|
- MONGO_USERNAME=${USER}
|
|
|
|
|
- MONGO_PASSWORD=${PASSWORD}
|
2023-06-29 22:35:31 +08:00
|
|
|
|
restart: always
|
|
|
|
|
|
|
|
|
|
redis:
|
2023-07-06 10:58:07 +08:00
|
|
|
|
image: redis:7.0.0
|
2023-06-29 22:35:31 +08:00
|
|
|
|
ports:
|
|
|
|
|
- 16379:6379
|
2023-06-30 19:33:59 +08:00
|
|
|
|
container_name: redis
|
2023-06-29 22:35:31 +08:00
|
|
|
|
volumes:
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- ${DATA_DIR}/components/redis/data:/data
|
2023-06-29 22:35:31 +08:00
|
|
|
|
#redis config file
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- ${DATA_DIR}/components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
|
2023-06-29 22:35:31 +08:00
|
|
|
|
environment:
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
restart: always
|
|
|
|
|
sysctls:
|
|
|
|
|
net.core.somaxconn: 1024
|
2023-06-30 17:52:55 +08:00
|
|
|
|
command: redis-server --requirepass ${PASSWORD} --appendonly yes
|
2023-06-29 22:35:31 +08:00
|
|
|
|
|
2023-06-30 23:04:28 +08:00
|
|
|
|
|
2023-06-29 22:35:31 +08:00
|
|
|
|
zookeeper:
|
2023-07-06 10:58:07 +08:00
|
|
|
|
image: wurstmeister/zookeeper
|
2023-06-29 22:35:31 +08:00
|
|
|
|
ports:
|
|
|
|
|
- 2181:2181
|
|
|
|
|
container_name: zookeeper
|
|
|
|
|
volumes:
|
|
|
|
|
- /etc/localtime:/etc/localtime
|
|
|
|
|
environment:
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
restart: always
|
2022-05-13 10:06:56 +08:00
|
|
|
|
|
2023-06-30 23:04:28 +08:00
|
|
|
|
|
2023-06-29 22:35:31 +08:00
|
|
|
|
kafka:
|
|
|
|
|
image: wurstmeister/kafka
|
|
|
|
|
container_name: kafka
|
|
|
|
|
restart: always
|
2022-05-24 12:19:55 +08:00
|
|
|
|
ports:
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- 9092:9092
|
2023-06-29 22:35:31 +08:00
|
|
|
|
environment:
|
|
|
|
|
TZ: Asia/Shanghai
|
|
|
|
|
KAFKA_BROKER_ID: 0
|
2023-06-30 17:52:55 +08:00
|
|
|
|
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
|
|
|
|
KAFKA_CREATE_TOPICS: "latestMsgToRedis:8:1,msgToPush:8:1,offlineMsgToMongoMysql:8:1"
|
|
|
|
|
KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9092,OUTSIDE://103.116.45.174:9092
|
2022-05-24 12:19:55 +08:00
|
|
|
|
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9093
|
|
|
|
|
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT"
|
2022-05-24 12:25:41 +08:00
|
|
|
|
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
|
2023-06-29 22:35:31 +08:00
|
|
|
|
depends_on:
|
|
|
|
|
- zookeeper
|
|
|
|
|
|
2022-07-15 16:53:19 +08:00
|
|
|
|
minio:
|
|
|
|
|
image: minio/minio
|
|
|
|
|
ports:
|
|
|
|
|
- 10005:9000
|
|
|
|
|
- 9090:9090
|
|
|
|
|
container_name: minio
|
|
|
|
|
volumes:
|
|
|
|
|
- /mnt/data:/data
|
|
|
|
|
- /mnt/config:/root/.minio
|
|
|
|
|
environment:
|
2023-06-30 17:52:55 +08:00
|
|
|
|
MINIO_ROOT_USER: ${USER}
|
|
|
|
|
MINIO_ROOT_PASSWORD: ${PASSWORD}
|
2022-07-15 16:53:19 +08:00
|
|
|
|
restart: always
|
|
|
|
|
command: minio server /data --console-address ':9090'
|
|
|
|
|
|
2023-06-29 22:35:31 +08:00
|
|
|
|
|
2023-07-05 15:26:07 +08:00
|
|
|
|
openim_server:
|
2023-07-14 22:10:01 +08:00
|
|
|
|
image: ghcr.io/openimsdk/openim-server:v3.0
|
2023-07-11 21:13:06 +08:00
|
|
|
|
container_name: openim-server
|
2023-06-29 22:35:31 +08:00
|
|
|
|
volumes:
|
2023-06-30 19:33:59 +08:00
|
|
|
|
- ./logs:/Open-IM-Server/logs
|
2023-06-29 22:35:31 +08:00
|
|
|
|
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
|
2023-06-30 17:52:55 +08:00
|
|
|
|
- ./config/notification.yaml:/Open-IM-Server/config/notification.yaml
|
|
|
|
|
- ${DATA_DIR}/db/sdk:/Open-IM-Server/db/sdk
|
2023-06-30 23:22:16 +08:00
|
|
|
|
- ./scripts:/Open-IM-Server/scripts
|
2023-06-29 22:35:31 +08:00
|
|
|
|
restart: always
|
|
|
|
|
depends_on:
|
|
|
|
|
- kafka
|
|
|
|
|
- mysql
|
|
|
|
|
- mongodb
|
|
|
|
|
- redis
|
2022-06-27 13:22:35 +08:00
|
|
|
|
- minio
|
2023-06-29 22:35:31 +08:00
|
|
|
|
network_mode: "host"
|
|
|
|
|
logging:
|
|
|
|
|
driver: json-file
|
|
|
|
|
options:
|
|
|
|
|
max-size: "1g"
|
|
|
|
|
max-file: "2"
|
2023-06-30 17:52:55 +08:00
|
|
|
|
|
2023-06-30 23:22:16 +08:00
|
|
|
|
openim_chat:
|
2023-07-14 21:54:23 +08:00
|
|
|
|
image: ghcr.io/openimsdk/openim-chat:v1.0.0
|
2023-06-30 23:22:16 +08:00
|
|
|
|
container_name: openim_chat
|
2023-06-30 17:52:55 +08:00
|
|
|
|
restart: always
|
|
|
|
|
depends_on:
|
|
|
|
|
- mysql
|
|
|
|
|
- mongodb
|
|
|
|
|
- redis
|
|
|
|
|
- minio
|
2023-07-05 15:26:07 +08:00
|
|
|
|
- openim_server
|
2023-06-30 17:52:55 +08:00
|
|
|
|
network_mode: "host"
|
|
|
|
|
logging:
|
|
|
|
|
driver: json-file
|
|
|
|
|
options:
|
|
|
|
|
max-size: "1g"
|
|
|
|
|
max-file: "2"
|
|
|
|
|
|
|
|
|
|
prometheus:
|
|
|
|
|
image: prom/prometheus
|
|
|
|
|
volumes:
|
|
|
|
|
- ./.docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
|
|
|
|
|
container_name: prometheus
|
|
|
|
|
# ports:
|
|
|
|
|
# - 9091:9091
|
|
|
|
|
depends_on:
|
2023-07-05 15:26:07 +08:00
|
|
|
|
- openim_server
|
2023-06-30 17:52:55 +08:00
|
|
|
|
command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
|
2023-07-06 10:58:07 +08:00
|
|
|
|
network_mode: "host"
|
2023-06-30 17:52:55 +08:00
|
|
|
|
|
|
|
|
|
grafana:
|
|
|
|
|
image: grafana/grafana
|
|
|
|
|
volumes:
|
2023-07-06 10:58:07 +08:00
|
|
|
|
- ./.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
|
2023-06-30 17:52:55 +08:00
|
|
|
|
container_name: grafana
|
|
|
|
|
depends_on:
|
2023-07-06 10:58:07 +08:00
|
|
|
|
- prometheus
|
|
|
|
|
network_mode: "host"
|
2023-06-30 17:52:55 +08:00
|
|
|
|
|
|
|
|
|
# node-exporter:
|
|
|
|
|
# image: quay.io/prometheus/node-exporter
|
|
|
|
|
# container_name: node-exporter
|
|
|
|
|
# restart: always
|
|
|
|
|
# ports:
|
2023-07-02 17:43:23 +08:00
|
|
|
|
# - "9100:9100"
|