Files
open-im-server/docker-compose.yaml
T

122 lines
3.2 KiB
YAML
Raw Normal View History

2022-02-25 15:36:29 +08:00
version: "3"
2021-07-15 11:02:54 +08:00
#fixme Clone openIM Server project before using docker-compose,project addresshttps://github.com/OpenIMSDK/Open-IM-Server.git
2021-06-28 15:43:00 +08:00
services:
mysql:
image: mysql:5.7
ports:
2021-11-23 09:57:58 +08:00
- 13306:3306
- 23306:33060
2021-06-28 15:43:00 +08:00
container_name: mysql
volumes:
2021-09-11 21:00:18 +08:00
- ./components/mysql/data:/var/lib/mysql
2021-07-15 11:02:54 +08:00
- /etc/localtime:/etc/localtime
2021-06-28 15:43:00 +08:00
environment:
2021-07-15 12:33:24 +08:00
MYSQL_ROOT_PASSWORD: openIM
2021-06-28 15:43:00 +08:00
restart: always
mongodb:
image: mongo:4.0
2021-06-28 15:43:00 +08:00
ports:
2021-11-23 09:57:58 +08:00
- 37017:27017
2021-06-28 15:43:00 +08:00
container_name: mongo
volumes:
2021-11-29 16:43:22 +08:00
- ./components/mongodb/data/db:/data/db
- ./components/mongodb/data/logs:/data/logs
- ./components/mongodb/data/conf:/etc/mongo
2022-03-02 09:45:12 +08:00
environment:
- TZ=Asia/Shanghai
# cache
- wiredTigerCacheSizeGB=1
2021-11-29 16:43:22 +08:00
# environment:
# - MONGO_INITDB_ROOT_USERNAME=openIM
# - MONGO_INITDB_ROOT_PASSWORD=openIM
2021-11-23 09:57:58 +08:00
2021-11-23 09:57:58 +08:00
#TZ: Asia/Shanghai
2021-06-28 15:43:00 +08:00
restart: always
redis:
image: redis
ports:
2021-11-23 09:57:58 +08:00
- 16379:6379
2021-06-28 15:43:00 +08:00
container_name: redis
volumes:
2021-09-11 21:00:18 +08:00
- ./components/redis/data:/data
2021-09-11 23:33:26 +08:00
#redis config file
#- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
2021-07-15 11:02:54 +08:00
environment:
TZ: Asia/Shanghai
2021-06-28 15:43:00 +08:00
restart: always
2021-07-15 11:02:54 +08:00
sysctls:
net.core.somaxconn: 1024
2021-09-11 23:33:26 +08:00
command: redis-server --requirepass openIM --appendonly yes
2021-07-15 11:02:54 +08:00
2021-06-28 15:43:00 +08:00
zookeeper:
image: wurstmeister/zookeeper
ports:
- 2181:2181
container_name: zookeeper
volumes:
- /etc/localtime:/etc/localtime
2021-07-15 11:02:54 +08:00
environment:
TZ: Asia/Shanghai
2021-06-28 15:43:00 +08:00
restart: always
2022-05-13 10:06:56 +08:00
2021-06-28 15:43:00 +08:00
kafka:
image: wurstmeister/kafka
container_name: kafka
restart: always
2022-05-24 12:19:55 +08:00
ports:
- 9093:9093
2021-06-28 15:43:00 +08:00
environment:
2021-07-15 11:02:54 +08:00
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
2021-09-11 23:01:13 +08:00
KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181
2022-06-16 12:21:49 +08:00
KAFKA_CREATE_TOPICS: "ws2ms_chat:2:1,ms2ps_chat:2:1,msg_to_mongo: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
2021-09-13 15:27:59 +08:00
network_mode: "host"
2021-06-28 15:43:00 +08:00
depends_on:
- zookeeper
etcd:
2021-07-15 11:02:54 +08:00
image: quay.io/coreos/etcd
2021-06-28 15:43:00 +08:00
ports:
- 2379:2379
- 2380:2380
2021-07-15 11:02:54 +08:00
container_name: etcd
volumes:
2021-07-15 12:33:24 +08:00
- /etc/timezone:/etc/timezone
2021-07-15 11:02:54 +08:00
- /etc/localtime:/etc/localtime
environment:
ETCDCTL_API: 3
2021-06-28 15:43:00 +08:00
restart: always
2021-07-15 11:02:54 +08:00
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
2021-11-23 09:57:58 +08:00
open_im_server:
2022-05-13 21:58:28 +08:00
image: openim/open_im_server:v2.0.10
2021-11-23 09:57:58 +08:00
container_name: open_im_server
2021-06-28 15:43:00 +08:00
volumes:
2021-09-11 21:00:18 +08:00
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
2021-11-23 09:57:58 +08:00
- ./db/sdk:/Open-IM-Server/db/sdk
2021-11-24 10:19:12 +08:00
- ./script:/Open-IM-Server/script
2021-06-28 15:43:00 +08:00
restart: always
depends_on:
2021-07-15 11:02:54 +08:00
- kafka
2021-06-28 15:43:00 +08:00
- mysql
- mongodb
- redis
2021-09-11 21:00:18 +08:00
- etcd
network_mode: "host"
logging:
driver: json-file
options:
max-size: "1g"
max-file: "2"