Skip to content

Commit

Permalink
Update basic-openim-server-dependency.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cubxxw authored Sep 5, 2023
1 parent a4a3360 commit 22532fb
Showing 1 changed file with 58 additions and 26 deletions.
84 changes: 58 additions & 26 deletions example/basic-openim-server-dependency.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#fixme Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git
version: '3'

networks:
openim-base:
driver: bridge
ipam:
driver: default
config:
- subnet: '${DOCKER_BRIDGE_SUBNET}'
gateway: '${DOCKER_BRIDGE_GATEWAY}'

services:
mysql:
image: mysql:5.7
Expand All @@ -13,6 +22,9 @@ services:
environment:
MYSQL_ROOT_PASSWORD: "${MYSQL_PASSWORD}"
restart: always
networks:
openim-base:
ipv4_address: ${MYSQL_NETWORK_ADDRESS}

mongodb:
image: mongo:6.0.2
Expand All @@ -24,20 +36,23 @@ services:
- "${DATA_DIR}/components/mongodb/data/db:/data/db"
- "${DATA_DIR}/components/mongodb/data/logs:/data/logs"
- "${DATA_DIR}/components/mongodb/data/conf:/etc/mongo"
- "./scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro"
- "${DATA_DIR}/scripts/mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro"
environment:
- TZ=Asia/Shanghai
- wiredTigerCacheSizeGB=1
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
- MONGO_INITDB_DATABASE=${MONGO_DATABASE}
restart: always
networks:
openim-base:
ipv4_address: ${MONGO_NETWORK_ADDRESS}

redis:
image: redis:7.0.0
container_name: redis
ports:
- "${REDIS_PORT}:6379"
container_name: redis
volumes:
- "${DATA_DIR}/components/redis/data:/data"
- "${DATA_DIR}/components/redis/config/redis.conf:/usr/local/redis/config/redis.conf"
Expand All @@ -47,37 +62,51 @@ services:
sysctls:
net.core.somaxconn: 1024
command: redis-server --requirepass ${REDIS_PASSWORD} --appendonly yes
networks:
openim-base:
ipv4_address: ${REDIS_NETWORK_ADDRESS}

zookeeper:
image: wurstmeister/zookeeper
ports:
- "${ZOOKEEPER_PORT}:2181"
container_name: zookeeper
volumes:
- "/etc/localtime:/etc/localtime"
environment:
TZ: Asia/Shanghai
restart: always
network_mode: "host"
image: bitnami/zookeeper:3.8
container_name: zookeeper
ports:
- "${ZOOKEEPER_PORT}:2181"
volumes:
- "/etc/localtime:/etc/localtime"
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
- TZ="Asia/Shanghai"
restart: always
networks:
openim-base:
ipv4_address: ${ZOOKEEPER_NETWORK_ADDRESS}

kafka:
image: wurstmeister/kafka
image: 'bitnami/kafka:3.5.1'
container_name: kafka
user: root
restart: always
ports:
- "${KAFKA_PORT}:9092"
- "${KAFKA_PORT}:9094"
volumes:
- ${DATA_DIR}/scripts/create_topic.sh:/opt/bitnami/kafka/create_topic.sh
- ${DATA_DIR}/components/kafka:/bitnami/kafka
command: >
bash -c "
/opt/bitnami/scripts/kafka/run.sh & sleep 5; /opt/bitnami/kafka/create_topic.sh; wait
"
environment:
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
KAFKA_ZOOKEEPER_CONNECT: "${ZOOKEEPER_ADDRESS}:${ZOOKEEPER_PORT}"
KAFKA_CREATE_TOPICS: "${KAFKA_LATESTMSG_REDIS_TOPIC}:8:1,${KAFKA_MSG_PUSH_TOPIC}:8:1,${KAFKA_OFFLINEMSG_MONGO_TOPIC}:8:1"
KAFKA_ADVERTISED_LISTENERS: INSIDE://${KAFKA_ADDR}:${KAFKA_PORT},OUTSIDE://CHANGE_TO_YOUR_EXTERNAL_IP:${KAFKA_PORT}
KAFKA_LISTENERS: INSIDE://:9092,OUTSIDE://:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT"
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
depends_on:
- zookeeper
network_mode: "host"
- TZ=Asia/Shanghai
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@<your_host>:9093
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://${DOCKER_BRIDGE_GATEWAY}:${KAFKA_PORT}
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
networks:
openim-base:
ipv4_address: ${KAFKA_NETWORK_ADDRESS}

minio:
image: minio/minio
Expand All @@ -92,4 +121,7 @@ services:
MINIO_ROOT_USER: "${MINIO_ACCESS_KEY}"
MINIO_ROOT_PASSWORD: "${MINIO_SECRET_KEY}"
restart: always
command: minio server /data --console-address ':9090'
command: minio server /data --console-address ':9090'
networks:
openim-base:
ipv4_address: ${MINIO_NETWORK_ADDRESS}

0 comments on commit 22532fb

Please sign in to comment.