Skip to content

Commit

Permalink
feat: add openim config ete code
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
  • Loading branch information
cubxxw committed Nov 15, 2023
1 parent 3754191 commit 13baa9a
Show file tree
Hide file tree
Showing 31 changed files with 2,025 additions and 8,940 deletions.
29 changes: 26 additions & 3 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MINIO_ENDPOINT=http://172.28.0.1:10005

# Base URL for the application programming interface (API).
# Default: API_URL=http://172.28.0.1:10002
API_URL=http://142.3.2.31:10002
API_URL=http://14.153.79.23:10002

# Directory path for storing data files or related information.
# Default: DATA_DIR=./
Expand All @@ -41,7 +41,7 @@ DATA_DIR=/root/workspaces/openim/openim-docker/openim-server/release-v3.4
# export IMAGE_REGISTRY="ghcr.io/openimsdk"
# export IMAGE_REGISTRY="openim"
# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk"
IMAGE_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openimsdk
IMAGE_REGISTRY=ghcr.io/openimsdk

# ======================================
# ========= Network Configuration ======
Expand Down Expand Up @@ -98,7 +98,14 @@ PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
# Address or hostname for the Grafana network.
# Default: GRAFANA_NETWORK_ADDRESS=172.28.0.12
GRAFANA_NETWORK_ADDRESS=172.28.0.12


# Address or hostname for the node_exporter network.
# Default: NODE_EXPORTER_NETWORK_ADDRESS=172.28.0.13
NODE_EXPORTER_NETWORK_ADDRESS=172.28.0.13

# Address or hostname for the OpenIM admin network.
# Default: OPENIM_ADMIN_NETWORK_ADDRESS=172.28.0.14
OPENIM_ADMIN_FRONT_NETWORK_ADDRESS=172.28.0.14

# ===============================================
# = Component Extension Configuration =
Expand Down Expand Up @@ -283,3 +290,19 @@ SERVER_BRANCH=release-v3.4
# Port for the OpenIM admin API.
# Default: OPENIM_ADMIN_API_PORT=10009
OPENIM_ADMIN_API_PORT=10009

# Port for the node exporter.
# Default: NODE_EXPORTER_PORT=19100
NODE_EXPORTER_PORT=19100

# Port for the prometheus.
# Default: PROMETHEUS_PORT=19090
PROMETHEUS_PORT=19090

# Port for the grafana.
# Default: GRAFANA_PORT=3000
GRAFANA_PORT=3000

# Port for the admin front.
# Default: OPENIM_ADMIN_FRONT_PORT=11002
OPENIM_ADMIN_FRONT_PORT=11002
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,20 @@ To ensure you get the latest version of the image, please refer to the following
```bash
export PASSWORD="openIM123" # Set password, default is openIM123
export USER="root" # Set username, default is root
# Choose chat version and server version https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md, eg: main, release-v*.*
export CHAT_BRANCH="main" # Set chat version, default is release-v3.3 (unstable)
export SERVER_BRANCH="main" # Set server version, default is release-v3.3 (unstable)
# Choose chat version and server version https://github.com/OpenIMSDK/Open-IM-Server/blob/main/docs/conversions/images.md, eg: release-v*.*
export CHAT_BRANCH="release-v1.4" # Set chat version, default is release-v1.4 (unstable)
export SERVER_BRANCH="release-v3.4" # Set server version, default is release-v3.4 (unstable)
# ...... other environment variables
# MONGO_USERNAME: Set MongoDB username
# MONGO_PASSWORD: Set MongoDB password
# MONGO_DATABASE: Set MongoDB database name
# MINIO_ENDPOINT: Set MinIO service address
# API_URL: In a local network environment, set OpenIM Server API address
export API_URL="http://127.0.0.1:10002"
# OPENIM_IP: In a local network environment, set OpenIM Server API address
export OPENIM_IP="127.0.0.1"
# DOCKER_BRIDGE_SUBNET: Set Docker bridge network address, default is 172.28.0.0/16
export DOCKER_BRIDGE_SUBNET=172.28.0.0/16
# For Prometheus, it is not enabled by default. To enable it
export PROMETHEUS_ENABLE=true # Default is false
```

These are just a few common configuration options. If you don't need them, you can read through our [config center instructions](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md).
Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# PR
# 欢迎 PR 贡献文档
53 changes: 34 additions & 19 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,38 +214,53 @@ services:
openim-server:
ipv4_address: ${OPENIM_CHAT_NETWORK_ADDRESS}

openim-admin:
image: ${IMAGE_REGISTRY}/openim-admin-front:v3.4.0
# image: ghcr.io/openimsdk/openim-admin-front:v3.4.0
# image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-admin-front:v3.4.0
# image: openim/openim-admin-front:v3.4.0
container_name: openim-admin
restart: always
ports:
- "${OPENIM_ADMIN_FRONT_PORT}:80"
networks:
openim-server:
ipv4_address: ${OPENIM_ADMIN_FRONT_NETWORK_ADDRESS}

prometheus:
image: prom/prometheus
volumes:
- ./openim-server/${SERVER_BRANCH}/.docker-compose_cfg/prometheus-compose.yml:/etc/prometheus/prometheus.yml
container_name: prometheus
hostname: prometheus
restart: always
volumes:
- ./openim-server/${SERVER_BRANCH}/config/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- ${PROMETHEUS_PORT}:9091
depends_on:
- openim-server
command: --web.listen-address=:9091 --config.file="/etc/prometheus/prometheus.yml"
- "${PROMETHEUS_PORT}:9090"
networks:
openim-server:
ipv4_address: ${PROMETHEUS_NETWORK_ADDRESS}

grafana:
image: grafana/grafana
volumes:
- ./openim-server/${SERVER_BRANCH}/.docker-compose_cfg/datasource-compose.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
- ./openim-server/${SERVER_BRANCH}/.docker-compose_cfg/grafana.ini:/etc/grafana/grafana.ini
- ./openim-server/${SERVER_BRANCH}/.docker-compose_cfg/node-exporter-full_rev1.json:/var/lib/grafana/dashboards/node-exporter-full_rev1.json
container_name: grafana
hostname: grafana
user: root
restart: always
ports:
- ${GRAFANA_PORT}:3000
depends_on:
- prometheus
- "${GRAFANA_PORT}:3000"
volumes:
- ${DATA_DIR}/components/grafana:/var/lib/grafana
networks:
openim-server:
ipv4_address: ${GRAFANA_NETWORK_ADDRESS}

# node-exporter:
# image: quay.io/prometheus/node-exporter
# container_name: node-exporter
# restart: always
# ports:
# - "9100:9100"
node-exporter:
image: quay.io/prometheus/node-exporter
container_name: node-exporter
hostname: node-exporter
restart: always
ports:
- "${NODE_EXPORTER_PORT}:9100"
networks:
openim-server:
ipv4_address: ${NODE_EXPORTER_NETWORK_ADDRESS}
29 changes: 26 additions & 3 deletions example/.env
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ MINIO_ENDPOINT=http://172.28.0.1:10005

# Base URL for the application programming interface (API).
# Default: API_URL=http://172.28.0.1:10002
API_URL=http://142.3.2.31:10002
API_URL=http://14.153.79.23:10002

# Directory path for storing data files or related information.
# Default: DATA_DIR=./
Expand All @@ -41,7 +41,7 @@ DATA_DIR=/root/workspaces/openim/openim-docker/openim-server/release-v3.4
# export IMAGE_REGISTRY="ghcr.io/openimsdk"
# export IMAGE_REGISTRY="openim"
# export IMAGE_REGISTRY="registry.cn-hangzhou.aliyuncs.com/openimsdk"
IMAGE_REGISTRY=registry.cn-hangzhou.aliyuncs.com/openimsdk
IMAGE_REGISTRY=ghcr.io/openimsdk

# ======================================
# ========= Network Configuration ======
Expand Down Expand Up @@ -98,7 +98,14 @@ PROMETHEUS_NETWORK_ADDRESS=172.28.0.11
# Address or hostname for the Grafana network.
# Default: GRAFANA_NETWORK_ADDRESS=172.28.0.12
GRAFANA_NETWORK_ADDRESS=172.28.0.12


# Address or hostname for the node_exporter network.
# Default: NODE_EXPORTER_NETWORK_ADDRESS=172.28.0.13
NODE_EXPORTER_NETWORK_ADDRESS=172.28.0.13

# Address or hostname for the OpenIM admin network.
# Default: OPENIM_ADMIN_NETWORK_ADDRESS=172.28.0.14
OPENIM_ADMIN_FRONT_NETWORK_ADDRESS=172.28.0.14

# ===============================================
# = Component Extension Configuration =
Expand Down Expand Up @@ -283,3 +290,19 @@ SERVER_BRANCH=release-v3.4
# Port for the OpenIM admin API.
# Default: OPENIM_ADMIN_API_PORT=10009
OPENIM_ADMIN_API_PORT=10009

# Port for the node exporter.
# Default: NODE_EXPORTER_PORT=19100
NODE_EXPORTER_PORT=19100

# Port for the prometheus.
# Default: PROMETHEUS_PORT=19090
PROMETHEUS_PORT=19090

# Port for the grafana.
# Default: GRAFANA_PORT=3000
GRAFANA_PORT=3000

# Port for the admin front.
# Default: OPENIM_ADMIN_FRONT_PORT=11002
OPENIM_ADMIN_FRONT_PORT=11002
79 changes: 0 additions & 79 deletions openim-server/release-v3.4/.docker-compose_cfg/config.yaml

This file was deleted.

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 13baa9a

Please sign in to comment.