mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-28 06:22:12 +08:00
add docker-compose env file, Mac compatible
This commit is contained in:
parent
355c9adda1
commit
33f23c291f
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,5 +5,4 @@ components
|
|||||||
logs
|
logs
|
||||||
out-test
|
out-test
|
||||||
.github
|
.github
|
||||||
|
.idea
|
||||||
|
|
||||||
|
|||||||
@ -5,10 +5,10 @@ serverversion: 1.0.3
|
|||||||
#---------------Infrastructure configuration---------------------#
|
#---------------Infrastructure configuration---------------------#
|
||||||
etcd:
|
etcd:
|
||||||
etcdSchema: openIM
|
etcdSchema: openIM
|
||||||
etcdAddr: [ 127.0.0.1:2379 ]
|
etcdAddr: [ etcd:2379 ]
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
dbMysqlAddress: [ 127.0.0.1:13306 ]
|
dbMysqlAddress: [ mysql:3306 ]
|
||||||
dbMysqlUserName: root
|
dbMysqlUserName: root
|
||||||
dbMysqlPassword: openIM
|
dbMysqlPassword: openIM
|
||||||
dbMysqlDatabaseName: openIM
|
dbMysqlDatabaseName: openIM
|
||||||
@ -19,7 +19,7 @@ mysql:
|
|||||||
dbMaxLifeTime: 120
|
dbMaxLifeTime: 120
|
||||||
|
|
||||||
mongo:
|
mongo:
|
||||||
dbAddress: [ 127.0.0.1:37017 ]
|
dbAddress: [ mongo:27017 ]
|
||||||
dbDirect: false
|
dbDirect: false
|
||||||
dbTimeout: 10
|
dbTimeout: 10
|
||||||
dbDatabase: openIM
|
dbDatabase: openIM
|
||||||
@ -30,7 +30,7 @@ mongo:
|
|||||||
dbRetainChatRecords: 7
|
dbRetainChatRecords: 7
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
dbAddress: 127.0.0.1:16379
|
dbAddress: redis:6379
|
||||||
dbMaxIdle: 128
|
dbMaxIdle: 128
|
||||||
dbMaxActive: 0
|
dbMaxActive: 0
|
||||||
dbIdleTimeout: 120
|
dbIdleTimeout: 120
|
||||||
@ -38,10 +38,10 @@ redis:
|
|||||||
|
|
||||||
kafka:
|
kafka:
|
||||||
ws2mschat:
|
ws2mschat:
|
||||||
addr: [ 127.0.0.1:9092 ]
|
addr: [ kafka:9092 ]
|
||||||
topic: "ws2ms_chat"
|
topic: "ws2ms_chat"
|
||||||
ms2pschat:
|
ms2pschat:
|
||||||
addr: [ 127.0.0.1:9092 ]
|
addr: [ kafka:9092 ]
|
||||||
topic: "ms2ps_chat"
|
topic: "ms2ps_chat"
|
||||||
consumergroupid:
|
consumergroupid:
|
||||||
msgToMongo: mongo
|
msgToMongo: mongo
|
||||||
|
|||||||
@ -3,38 +3,37 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mysql:5.7
|
image: mysql:${MYSQL_VERSION}
|
||||||
ports:
|
ports:
|
||||||
- 13306:3306
|
- ${MYSQL_3306_PORT}:3306
|
||||||
- 23306:33060
|
|
||||||
container_name: mysql
|
container_name: mysql
|
||||||
volumes:
|
volumes:
|
||||||
- ./components/mysql/data:/var/lib/mysql
|
- ./components/mysql/data:/var/lib/mysql
|
||||||
- /etc/localtime:/etc/localtime
|
- /etc/localtime:/etc/localtime
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: openIM
|
MYSQL_ROOT_PASSWORD: ${MYSQL_PWD}
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
image: mongo:4.0
|
image: mongo:${MONGO_VERSION}
|
||||||
ports:
|
ports:
|
||||||
- 37017:27017
|
- ${MONGO_PORT}:27017
|
||||||
container_name: mongo
|
container_name: mongo
|
||||||
volumes:
|
volumes:
|
||||||
- ./components/mongodb/data/db:/data/db
|
- ./components/mongodb/data/db:/data/db
|
||||||
- ./components/mongodb/data/logs:/data/logs
|
- ./components/mongodb/data/logs:/data/logs
|
||||||
- ./components/mongodb/data/conf:/etc/mongo
|
- ./components/mongodb/data/conf:/etc/mongo
|
||||||
environment:
|
environment:
|
||||||
- MONGO_INITDB_ROOT_USERNAME=openIM
|
- MONGO_INITDB_ROOT_USERNAME=${MONGO_ROOT_USERNAME}
|
||||||
- MONGO_INITDB_ROOT_PASSWORD=openIM
|
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PWD}
|
||||||
|
|
||||||
#TZ: Asia/Shanghai
|
#TZ: Asia/Shanghai
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis:${REDIS_VERSION}
|
||||||
ports:
|
ports:
|
||||||
- 16379:6379
|
- ${REDIS_PORT}:6379
|
||||||
container_name: redis
|
container_name: redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./components/redis/data:/data
|
- ./components/redis/data:/data
|
||||||
@ -51,7 +50,7 @@ services:
|
|||||||
zookeeper:
|
zookeeper:
|
||||||
image: wurstmeister/zookeeper
|
image: wurstmeister/zookeeper
|
||||||
ports:
|
ports:
|
||||||
- 2181:2181
|
- ${ZOOKEEPER_PORT}:2181
|
||||||
container_name: zookeeper
|
container_name: zookeeper
|
||||||
volumes:
|
volumes:
|
||||||
- /etc/localtime:/etc/localtime
|
- /etc/localtime:/etc/localtime
|
||||||
@ -67,18 +66,17 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
KAFKA_BROKER_ID: 0
|
KAFKA_BROKER_ID: 0
|
||||||
KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181
|
KAFKA_ZOOKEEPER_CONNECT: ${KAFKA_ZOOKEEPER_CONNECT}
|
||||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092
|
KAFKA_ADVERTISED_LISTENERS: ${KAFKA_ADVERTISED_LISTENERS}
|
||||||
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
|
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
|
||||||
network_mode: "host"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- zookeeper
|
- zookeeper
|
||||||
|
|
||||||
etcd:
|
etcd:
|
||||||
image: quay.io/coreos/etcd
|
image: quay.io/coreos/etcd
|
||||||
ports:
|
ports:
|
||||||
- 2379:2379
|
- ${ETCD_2379_PORT}:2379
|
||||||
- 2380:2380
|
- ${ETCD_2380_PORT}:2380
|
||||||
container_name: etcd
|
container_name: etcd
|
||||||
volumes:
|
volumes:
|
||||||
- /etc/timezone:/etc/timezone
|
- /etc/timezone:/etc/timezone
|
||||||
@ -89,8 +87,11 @@ services:
|
|||||||
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
|
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:
|
open_im_server:
|
||||||
image: openim/open_im_server
|
image: openim/open_im_server:${OPEN_IM_SERVER_VERSION}
|
||||||
container_name: open_im_server
|
container_name: open_im_server
|
||||||
|
ports:
|
||||||
|
- ${OPEN_IM_API_PORT}:10000
|
||||||
|
- ${OPEN_IM_SDK_WS_PORT}:30000
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/Open-IM-Server/logs
|
- ./logs:/Open-IM-Server/logs
|
||||||
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
|
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
|
||||||
@ -104,7 +105,6 @@ services:
|
|||||||
- mongodb
|
- mongodb
|
||||||
- redis
|
- redis
|
||||||
- etcd
|
- etcd
|
||||||
network_mode: "host"
|
|
||||||
logging:
|
logging:
|
||||||
driver: json-file
|
driver: json-file
|
||||||
options:
|
options:
|
||||||
|
|||||||
30
env-example
Normal file
30
env-example
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
#mysql config
|
||||||
|
MYSQL_VERSION=5.7
|
||||||
|
MYSQL_PWD=openIM
|
||||||
|
MYSQL_3306_PORT=3306
|
||||||
|
|
||||||
|
#mongodb config
|
||||||
|
MONGO_VERSION=4.0
|
||||||
|
MONGO_PORT=27017
|
||||||
|
MONGO_ROOT_USERNAME=openIM
|
||||||
|
MONGO_ROOT_PWD=openIM
|
||||||
|
|
||||||
|
#redis config
|
||||||
|
REDIS_VERSION=latest
|
||||||
|
REDIS_PORT=6379
|
||||||
|
|
||||||
|
#zookeeper config
|
||||||
|
ZOOKEEPER_PORT=2181
|
||||||
|
|
||||||
|
#kafka config
|
||||||
|
KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||||
|
KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092
|
||||||
|
|
||||||
|
#etcd config
|
||||||
|
ETCD_2379_PORT=2379
|
||||||
|
ETCD_2380_PORT=2380
|
||||||
|
|
||||||
|
#open-im-server config
|
||||||
|
OPEN_IM_SERVER_VERSION=latest
|
||||||
|
OPEN_IM_SDK_WS_PORT=30000
|
||||||
|
OPEN_IM_API_PORT=10000
|
||||||
Loading…
x
Reference in New Issue
Block a user