From 8c3019545acab757d08185fed7245c0c633efccd Mon Sep 17 00:00:00 2001 From: xyctruth <398041993@qq.com> Date: Wed, 16 Feb 2022 14:45:26 +0800 Subject: [PATCH] =?UTF-8?q?docker-compose=20=E5=8E=BB=E9=99=A4=20=20networ?= =?UTF-8?q?k=5Fmode:=20"host",=20windows,=20mac=20=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20docker=20=20network=5Fmode:=20"host"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.docker.yaml | 166 ++++++++++++++++++++++++++++++++++++++ docker-compose.yaml | 15 ++-- 2 files changed, 174 insertions(+), 7 deletions(-) create mode 100644 config/config.docker.yaml diff --git a/config/config.docker.yaml b/config/config.docker.yaml new file mode 100644 index 000000000..a8f8f5c39 --- /dev/null +++ b/config/config.docker.yaml @@ -0,0 +1,166 @@ +# The class cannot be named by Pascal or camel case. +# If it is not used, the corresponding structure will not be set, +# and it will not be read naturally. +serverversion: 1.0.3 +#---------------Infrastructure configuration---------------------# +etcd: + etcdSchema: openIM + etcdAddr: [ etcd:2379 ] + +mysql: + dbMysqlAddress: [ mysql:3306 ] + dbMysqlUserName: root + dbMysqlPassword: openIM + dbMysqlDatabaseName: openIM + dbTableName: eMsg + dbMsgTableNum: 1 + dbMaxOpenConns: 20 + dbMaxIdleConns: 10 + dbMaxLifeTime: 120 + +mongo: + dbAddress: [ mongo:27017 ] + dbDirect: false + dbTimeout: 10 + dbDatabase: openIM + dbSource: admin + dbUserName: + dbPassword: + dbMaxPoolSize: 20 + dbRetainChatRecords: 7 + +redis: + dbAddress: redis:6379 + dbMaxIdle: 128 + dbMaxActive: 0 + dbIdleTimeout: 120 + dbPassWord: openIM + +kafka: + ws2mschat: + addr: [ kafka:9092 ] + topic: "ws2ms_chat" + ms2pschat: + addr: [ kafka:9092 ] + topic: "ms2ps_chat" + consumergroupid: + msgToMongo: mongo + msgToMySql: mysql + msgToPush: push + + + +#---------------Internal service configuration---------------------# + +# The service ip default is empty, +# automatically obtain the machine's valid network card ip as the service ip, +# otherwise the configuration ip is preferred +serverip: 0.0.0.0 + +api: + openImApiPort: [ 10000 ] +sdk: + openImSdkWsPort: [ 30000 ] + +credential: + tencent: + appID: 1302656840 + region: ap-chengdu + bucket: echat-1302656840 + secretID: AKIDGNYVChzIQinu7QEgtNp0hnNgqcV8vZTC + secretKey: kz15vW83qM6dBUWIq681eBZA0c0vlIbe + + +rpcport: + openImUserPort: [ 10100 ] + openImFriendPort: [ 10200 ] + openImOfflineMessagePort: [ 10300] + openImOnlineRelayPort: [ 10400 ] + openImGroupPort: [ 10500 ] + openImAuthPort: [ 10600 ] + openImPushPort: [ 10700 ] + + +rpcregistername: + openImUserName: User + openImFriendName: Friend + openImOfflineMessageName: OfflineMessage + openImPushName: Push + openImOnlineMessageRelayName: OnlineMessageRelay + openImGroupName: Group + openImAuthName: Auth + +log: + storageLocation: ../logs/ + rotationTime: 24 + remainRotationCount: 5 + remainLogLevel: 6 + elasticSearchSwitch: false + elasticSearchAddr: [ 127.0.0.1:9201 ] + elasticSearchUser: "" + elasticSearchPassword: "" + +modulename: + longConnSvrName: msg_gateway + msgTransferName: msg_transfer + pushName: push + +longconnsvr: + openImWsPort: [ 17778 ] + websocketMaxConnNum: 10000 + websocketMaxMsgLen: 4096 + websocketTimeOut: 10 + +push: + tpns: + ios: + accessID: 1600018281 + secretKey: 3cd68a77a95b89e5089a1aca523f318f + android: + accessID: 111 + secretKey: 111 + jpns: + appKey: cf47465a368f24c659608e7e + masterSecret: 02204efe3f3832947a236ee5 + pushUrl: "https://api.jpush.cn/v3/push" + pushIntent: "intent:#Intent;component=io.openim.app.enterprisechat/io.openim.app.enterprisechat.MainActivity;end" +manager: + appManagerUid: ["openIM123456","openIM654321"] + secrets: ["openIM1","openIM2"] + +secret: tuoyun + +multiloginpolicy: 1 + +#token config +tokenpolicy: + accessSecret: "open_im_server" + # Token effective time day as a unit + accessExpire: 7 + +messagecallback: + callbackSwitch: false + callbackUrl: "http://www.xxx.com/msg/judge" + #TimeOut use second as unit + callbackTimeOut: 10 + + +#---------------demo configuration---------------------# +#The following configuration items are applied to openIM Demo configuration +demoswitch: true +demo: + openImDemoPort: [ 42233 ] + alismsverify: + accessKeyId: LTAI5tJPkn4HuuePdiLdGqe71 + accessKeySecret: 4n9OJ7ZCVN1U6KeHDAtOyNeVZcjOuV1 + signName: OpenIM Corporation + verificationCodeTemplateCode: SMS_2268101641 + superCode: 666666 + mail: + title: "openIM" + senderMail: "1765567899@qq.com" + senderAuthorizationCode: "1gxyausfoevlzbfag" + smtpAddr: "smtp.qq.com" + smtpPort: 25 + + diff --git a/docker-compose.yaml b/docker-compose.yaml index 996c70308..204438a94 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -67,10 +67,9 @@ services: environment: TZ: Asia/Shanghai KAFKA_BROKER_ID: 0 - KAFKA_ZOOKEEPER_CONNECT: 127.0.0.1:2181 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://127.0.0.1:9092 - KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 - network_mode: "host" + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_LISTENERS: PLAINTEXT://kafka:9092 depends_on: - zookeeper @@ -93,10 +92,13 @@ services: container_name: open_im_server volumes: - ./logs:/Open-IM-Server/logs - - ./config/config.yaml:/Open-IM-Server/config/config.yaml + - ./config/config.docker.yaml:/Open-IM-Server/config/config.yaml - ./db/sdk:/Open-IM-Server/db/sdk - ./script:/Open-IM-Server/script - + ports: + - 30000:30000 + - 42233:42233 + - 10000:10000 restart: always depends_on: - kafka @@ -104,7 +106,6 @@ services: - mongodb - redis - etcd - network_mode: "host" logging: driver: json-file options: