openim-server/docker-compose.yaml

123 lines
3.2 KiB
YAML
Raw Normal View History

2023-06-29 22:35:31 +08:00
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:
- 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:
- 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:
- ./components/mongodb/data/db:/data/db
- ./components/mongodb/data/logs:/data/logs
- ./components/mongodb/data/conf:/etc/mongo
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
# environment:
# - MONGO_INITDB_ROOT_USERNAME=openIM
# - MONGO_INITDB_ROOT_PASSWORD=openIM
#TZ: Asia/Shanghai
restart: always
redis:
image: redis
ports:
- 16379:6379
container_name: redis
volumes:
- ./components/redis/data:/data
#redis config file
2022-06-23 11:06:17 +08:00
- ./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
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
2022-05-13 10:06:56 +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:
- 9093:9093
2023-06-29 22:35:31 +08:00
environment:
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181
2022-05-24 12:39:37 +08:00
KAFKA_CREATE_TOPICS: "ws2ms_chat:2:1,ms2ps_chat:2:1"
2022-05-24 12:24:53 +08:00
KAFKA_ADVERTISED_LISTENERS: INSIDE://127.0.0.1:9092,OUTSIDE://103.116.45.174:9093
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
network_mode: "host"
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
open_im_server:
2022-06-17 17:11:59 +08:00
image: openim/open_im_server:v2.1.0
2023-06-29 22:35:31 +08:00
container_name: open_im_server
volumes:
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
- ./db/sdk:/Open-IM-Server/db/sdk
- ./script:/Open-IM-Server/script
restart: always
depends_on:
- kafka
- mysql
- mongodb
- redis
- etcd
network_mode: "host"
logging:
driver: json-file
options:
max-size: "1g"
max-file: "2"