You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/docker-compose.yaml

175 lines
4.9 KiB

3 years ago
version: "3"
#fixme Clone openIM Server project before using docker-compose,project addresshttps://github.com/OpenIMSDK/Open-IM-Server.git
services:
mysql:
image: mysql:5.7
ports:
3 years ago
- 13306:3306
- 23306:33060
container_name: mysql
volumes:
- ./components/mysql/data:/var/lib/mysql
- /etc/localtime:/etc/localtime
environment:
MYSQL_ROOT_PASSWORD: openIM
restart: always
mongodb:
image: mongo:4.0
ports:
3 years ago
- 37017:27017
container_name: mongo
command: --wiredTigerCacheSizeGB 1
volumes:
- ./components/mongodb/data/db:/data/db
- ./components/mongodb/data/logs:/data/logs
- ./components/mongodb/data/conf:/etc/mongo
# - ./script/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# - MONGO_USERNAME=openIM
# - MONGO_PASSWORD=openIM
# - MONGO_INITDB_ROOT_USERNAME=root
# - MONGO_INITDB_ROOT_PASSWORD=root
# - MONGO_INITDB_DATABASE=openIM
restart: always
redis:
image: redis
ports:
3 years ago
- 16379:6379
container_name: redis
volumes:
- ./components/redis/data:/data
#redis config file
- ./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 openIM --appendonly yes
zookeeper:
image: wurstmeister/zookeeper
ports:
- 2181:2181
container_name: zookeeper
volumes:
- /etc/localtime:/etc/localtime
environment:
TZ: Asia/Shanghai
restart: always
3 years ago
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: user12345
MINIO_ROOT_PASSWORD: key12345
restart: always
command: minio server /data --console-address ':9090'
2 years ago
3 years ago
open_im_server:
2 years ago
image: openim/open_im_server:v2.3.2
3 years ago
container_name: open_im_server
volumes:
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
3 years ago
- ./db/sdk:/Open-IM-Server/db/sdk
3 years ago
- ./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"
2 years ago
prometheus:
image: prom/prometheus
volumes:
2 years ago
- ./docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
2 years ago
# - ./components/prometheus_data:/prometheus
2 years ago
container_name: prometheus
ports:
2 years ago
- 9091:9091
2 years ago
depends_on:
- open_im_server
2 years ago
command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
2 years ago
network_mode: "host"
2 years ago
grafana:
image: grafana/grafana
volumes:
2 years ago
# - ./grafana/dashboards/dashboard.json:/var/lib/grafana/dashboards/dashboard.json
# - ./grafana/provisioning/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
2 years ago
- ./docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
2 years ago
- ./docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
2 years ago
- ./docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json
2 years ago
container_name: grafana
ports:
2 years ago
- 10007:10007
2 years ago
depends_on:
2 years ago
- prometheus
2 years ago
network_mode: "host"
node-exporter:
image: quay.io/prometheus/node-exporter
container_name: node-exporter
restart: always
ports:
2 years ago
- "9100:9100"
2 years ago
# command: --collector.ENTER-THE-NAME-OF-COLLECTOR