open-im-server/docker-compose.env.yaml
jialei 593fe4469e
Dev (#90)
* edit README.md

* add env file
2021-12-08 20:00:22 +08:00

133 lines
3.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: "3"
#fixme Clone openIM Server project before using docker-compose,project addresshttps://github.com/OpenIMSDK/Open-IM-Server.git
services:
mysql:
image: mysql:${MYSQL_VERSION}
ports:
- ${MYSQL_3306_PORT}:3306
container_name: mysql
volumes:
- ./components/mysql/data:/var/lib/mysql
- /etc/localtime:/etc/localtime
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PWD}
restart: always
mongodb:
image: mongo:${MONGO_VERSION}
ports:
- ${MONGO_PORT}:27017
container_name: mongo
volumes:
- ./components/mongodb/data:/data/db
environment:
TZ: Asia/Shanghai
restart: always
redis:
image: redis:${REDIS_VERSION}
ports:
- ${REDIS_PORT}:6379
container_name: 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
ports:
- ${ZOOKEEPER_PORT}:2181
container_name: zookeeper
volumes:
- /etc/localtime:/etc/localtime
environment:
TZ: Asia/Shanghai
restart: always
kafka:
image: wurstmeister/kafka
container_name: kafka
restart: always
environment:
TZ: Asia/Shanghai
KAFKA_BROKER_ID: 0
KAFKA_ZOOKEEPER_CONNECT: ${KAFKA_ZOOKEEPER_CONNECT}
KAFKA_ADVERTISED_LISTENERS: ${KAFKA_ADVERTISED_LISTENERS}
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
depends_on:
- zookeeper
etcd:
image: quay.io/coreos/etcd
ports:
- ${ETCD_2379_PORT}:2379
- ${ETCD_2380_PORT}:2380
container_name: 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
# ports:
# - ${OPEN_IM_SDK_WS_PORT}:30000
# - ${OPEN_IM_API_PORT}:10000
# 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
# logging:
# driver: json-file
# options:
# max-size: "1g"
# max-file: "2"
#fixme----build from docker hub------
open-im-server:
image: lyt1123/open_im_server:${OPEN_IM_SERVER_VERSION}
container_name: open-im-server
ports:
- ${OPEN_IM_SDK_WS_PORT}:30000
- ${OPEN_IM_API_PORT}:10000
volumes:
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml
restart: always
depends_on:
- kafka
- mysql
- mongodb
- redis
- etcd
logging:
driver: json-file
options:
max-size: "1g"
max-file: "2"