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

130 lines
3.2 KiB
YAML
Raw Normal View History

2021-06-28 15:43:00 +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-03 17:51:53 +08:00
- 3306:3306
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:
2021-07-15 11:02:54 +08:00
image: mongo
2021-06-28 15:43:00 +08:00
ports:
2021-11-03 17:51:53 +08:00
- 27017:27017
2021-06-28 15:43:00 +08:00
container_name: mongo
volumes:
2021-09-11 21:00:18 +08:00
- ./components/mongodb/data:/data/db
2021-07-15 11:02:54 +08:00
environment:
TZ: Asia/Shanghai
2021-06-28 15:43:00 +08:00
restart: always
redis:
image: redis
ports:
2021-11-03 17:51:53 +08:00
- 6379: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:
2021-11-03 17:51:53 +08:00
- 2181:2181
2021-06-28 15:43:00 +08:00
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
kafka:
image: wurstmeister/kafka
container_name: kafka
restart: always
environment:
2021-07-15 11:02:54 +08:00
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
2021-11-03 17:51:53 +08:00
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
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:
2021-11-03 17:51:53 +08:00
- 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-11-03 17:51:53 +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-07-15 11:02:54 +08:00
2021-06-28 15:43:00 +08:00
2021-07-15 11:02:54 +08:00
#fixme-----build from dockerfile---------
2021-10-08 21:34:44 +08:00
# 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"
2021-06-28 15:43:00 +08:00
2021-07-15 11:02:54 +08:00
#fixme----build from docker hub------
2021-06-28 15:43:00 +08:00
open-im-server:
2021-11-03 17:51:53 +08:00
image: lyt1123/open_im_server
2021-06-28 15:43:00 +08:00
container_name: open-im-server
volumes:
2021-09-11 21:00:18 +08:00
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
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"