mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 11:22:10 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			146 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			146 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
version: "3"
 | 
						||
#fixme  Clone openIM Server project before using docker-compose,project address:https://github.com/OpenIMSDK/Open-IM-Server.git
 | 
						||
 | 
						||
services:
 | 
						||
  mysql:
 | 
						||
    image: mysql:5.7
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    container_name: open_im_mysql
 | 
						||
    volumes:
 | 
						||
      - ./components/mysql/data:/var/lib/mysql
 | 
						||
      - /etc/localtime:/etc/localtime
 | 
						||
    environment:
 | 
						||
      MYSQL_ROOT_PASSWORD: openIM
 | 
						||
    restart: always
 | 
						||
 | 
						||
  mongodb:
 | 
						||
    image: mongo:4.0
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    container_name: open_im_mongo
 | 
						||
    volumes:
 | 
						||
      - ./components/mongodb/data:/data/db
 | 
						||
    environment:
 | 
						||
      TZ: Asia/Shanghai
 | 
						||
    restart: always
 | 
						||
 | 
						||
  redis:
 | 
						||
    image: redis
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    container_name: open_im_redis
 | 
						||
    volumes:
 | 
						||
      - ./components/redis/data:/data
 | 
						||
      #redis config file
 | 
						||
      #- ./components/redis/config/redis.conf:/usr/local/redis/config/redis.conf
 | 
						||
    environment:
 | 
						||
      TZ: Asia/Shanghai
 | 
						||
    restart: always
 | 
						||
    sysctls:
 | 
						||
      net.core.somaxconn: 1024
 | 
						||
    command: redis-server --requirepass openIM --appendonly yes
 | 
						||
 | 
						||
 | 
						||
  zookeeper:
 | 
						||
    image: wurstmeister/zookeeper
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    container_name: open_im_zookeeper
 | 
						||
    volumes:
 | 
						||
      - /etc/localtime:/etc/localtime
 | 
						||
    environment:
 | 
						||
      TZ: Asia/Shanghai
 | 
						||
    restart: always
 | 
						||
 | 
						||
 | 
						||
  kafka:
 | 
						||
    image: wurstmeister/kafka
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    container_name: open_im_kafka
 | 
						||
    restart: always
 | 
						||
    environment:
 | 
						||
      TZ: Asia/Shanghai
 | 
						||
      KAFKA_BROKER_ID: 0
 | 
						||
      KAFKA_ZOOKEEPER_CONNECT: open_im_zookeeper:2181
 | 
						||
      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://open_im_kafka:9092
 | 
						||
      KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
 | 
						||
    depends_on:
 | 
						||
      - zookeeper
 | 
						||
 | 
						||
  etcd:
 | 
						||
    image: quay.io/coreos/etcd
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    container_name: open_im_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
 | 
						||
 | 
						||
 | 
						||
  #fixme-----build from dockerfile---------
 | 
						||
  # open-im-server:
 | 
						||
  #    image: open_im_server
 | 
						||
  #    container_name: open-im-server
 | 
						||
  #    volumes:
 | 
						||
  #      - ./logs:/Open-IM-Server/logs
 | 
						||
  #      - ./config/config.yaml:/Open-IM-Server/config/config.yaml
 | 
						||
  #    restart: always
 | 
						||
  #    build:
 | 
						||
  #      context: .
 | 
						||
  #      dockerfile: deploy.Dockerfile
 | 
						||
  #    depends_on:
 | 
						||
  #      - mysql
 | 
						||
  #      - mongodb
 | 
						||
  #      - redis
 | 
						||
  #      - kafka
 | 
						||
  #      - etcd
 | 
						||
  #    network_mode: "host"
 | 
						||
  #      logging:
 | 
						||
  #        driver: json-file
 | 
						||
  #        options:
 | 
						||
  #          max-size: "1g"
 | 
						||
  #          max-file: "2"
 | 
						||
 | 
						||
  #fixme----build from docker hub------
 | 
						||
  open-im-server:
 | 
						||
    image: lyt1123/open_im_server
 | 
						||
    container_name: open_im_server
 | 
						||
    volumes:
 | 
						||
      - ./logs:/Open-IM-Server/logs
 | 
						||
      - ./config/config.docker.yaml:/Open-IM-Server/config/config.yaml
 | 
						||
    restart: always
 | 
						||
    depends_on:
 | 
						||
      - kafka
 | 
						||
      - mysql
 | 
						||
      - mongodb
 | 
						||
      - redis
 | 
						||
      - etcd
 | 
						||
    networks:
 | 
						||
      - open_im_net
 | 
						||
    ports:
 | 
						||
      - "10000:10000"
 | 
						||
      - "30000:30000"
 | 
						||
      - "10100:10100"
 | 
						||
      - "10200:10200"
 | 
						||
      - "10300:10300"
 | 
						||
      - "10400:10400"
 | 
						||
      - "10500:10500"
 | 
						||
      - "10600:10600"
 | 
						||
      - "10700:10700"
 | 
						||
      - "17778:17778"
 | 
						||
    logging:
 | 
						||
      driver: json-file
 | 
						||
      options:
 | 
						||
        max-size: "1g"
 | 
						||
        max-file: "2"
 | 
						||
 | 
						||
networks:
 | 
						||
  open_im_net:
 | 
						||
    driver: bridge
 |