Skip to content

Commit ff541b2

Browse files
committed
fix: github gh images
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
1 parent 46763e2 commit ff541b2

File tree

2 files changed

+392
-167
lines changed

2 files changed

+392
-167
lines changed

README.md

Lines changed: 126 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# OpenIM Docker Deployment
22

3+
- [OpenIM Docker Deployment](#openim-docker-deployment)
4+
- [Directory Structure](#directory-structure)
5+
- [Project Structure Explanation](#project-structure-explanation)
6+
- [OpenIM Docker Usage Guide](#openim-docker-usage-guide)
7+
- [1. Obtain the Image](#1-obtain-the-image)
8+
- [2. Using Docker-compose](#2-using-docker-compose)
9+
- [One-click Deployment:](#one-click-deployment)
10+
- [Troubleshooting:](#troubleshooting)
11+
- [Modify Configuration Files:](#modify-configuration-files)
12+
- [1. Recommended: Use environment variables (as mentioned above).](#1-recommended-use-environment-variables-as-mentioned-above)
13+
- [2. Modify the automation script:](#2-modify-the-automation-script)
14+
- [3. Modify the `config.yaml` and `.env` files (but note that reusing `make init` to generate configurations will overwrite them).](#3-modify-the-configyaml-and-env-files-but-note-that-reusing-make-init-to-generate-configurations-will-overwrite-them)
15+
- [OpenIM Data Storage Architecture Guide](#openim-data-storage-architecture-guide)
16+
- [**II. OpenIM Default Data Storage Structure**](#ii-openim-default-data-storage-structure)
17+
- [III. Customizing OpenIM's Data Storage](#iii-customizing-openims-data-storage)
18+
- [IV. Docker Volume Storage: An Advanced Approach](#iv-docker-volume-storage-an-advanced-approach)
19+
- [Custom Startup](#custom-startup)
20+
- [3. Tips](#3-tips)
21+
- [Contribution](#contribution)
22+
- [Conclusion](#conclusion)
23+
- [License](#license)
24+
25+
326
OpenIM Docker offers a stable solution for building and deploying OpenIM. There are many deployment options available, and the process is simplified using Docker and Docker Compose.
427

528
<p align="center"> <a href="./README.md"><b> English </b></a> • <a href="./README_zh-CN.md"><b> 简体中文 </b></a> </p>
@@ -80,41 +103,42 @@ export SERVER_BRANCH="main" # Set server version, default is release-v3.3 (unsta
80103
# MINIO_ENDPOINT: Set MinIO service address
81104
# API_URL: In a local network environment, set OpenIM Server API address
82105
export API_URL="http://127.0.0.1:10002"
106+
# DOCKER_BRIDGE_SUBNET: Set Docker bridge network address, default is 172.28.0.0/16
107+
export DOCKER_BRIDGE_SUBNET=172.28.0.0/16
83108
```
84109

85110
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).
86111

87112
Render the required configuration via './scripts/init-config.sh 'or' make init '. It can be modified directly https://github.com/openimsdk/openim-docker/blob/main/scripts/install/environment.sh or set linux environment variables. For example, above `PASSWORD` and `USER`. The latter method works only on the current terminal
88113

89-
90114

91-
**One-click Deployment:**
115+
### One-click Deployment:
92116

93117
```bash
94118
git clone https://github.com/openim-sigs/openim-docker openim/openim-docker && export openim=$(pwd)/openim && cd $openim/openim-docker && ./scripts/init-config.sh && docker compose up -d
95119
```
96120

97-
**Troubleshooting:**
121+
#### Troubleshooting:
98122

99123
Common issues are documented in [FAQ.md](https://github.com/OpenIMSDK/openim-docker/blob/main/FAQ.md). If you encounter any issues, you can refer to this document.
100124

101125
It's also possible to find [issues](https://github.com/OpenIMSDK/openim-docker/issues) that have been encountered before, if not, please provide us with an [issue description](https://github.com/openimsdk/openim-docker/issues/new/choose)
102126

103127

104128

105-
**Modify Configuration Files:**
129+
#### Modify Configuration Files:
106130

107131
There are three ways to modify the configuration files:
108132

109-
1. Recommended: Use environment variables (as mentioned above).
133+
##### 1. Recommended: Use environment variables (as mentioned above).
110134

111135
**For updating configurations:**
112136

113137
```bash
114138
make init
115139
```
116140

117-
1. Modify the automation script:
141+
##### 2. Modify the automation script:
118142

119143
```bash
120144
scripts/install/environment.sh
@@ -126,7 +150,7 @@ To update the configuration:
126150
make init
127151
```
128152

129-
1. Modify the `config.yaml` and `.env` files (but note that reusing `make init` to generate configurations will overwrite them).
153+
##### 3. Modify the `config.yaml` and `.env` files (but note that reusing `make init` to generate configurations will overwrite them).
130154

131155
**Default Startup Selection:**
132156

@@ -142,6 +166,95 @@ image: registry.cn-hangzhou.aliyuncs.com/openimsdk/openim-server:latest
142166
# image: openim/openim-server:latest
143167
```
144168

169+
170+
## OpenIM Data Storage Architecture Guide
171+
172+
### **II. OpenIM Default Data Storage Structure**
173+
174+
**A. Overview**
175+
176+
At the heart of OpenIM's data storage are the essential components: Kafka, MNT, MongoDB, MySQL, and Redis. Each serves a distinct purpose and requires specific configuration and data directories for optimal performance.
177+
178+
**B. Directory Structure**
179+
180+
```bash
181+
$ tree components/ -d -L 2
182+
components/
183+
├── kafka
184+
│ ├── config
185+
│ └── data
186+
├── mnt
187+
│ ├── config
188+
│ └── data
189+
├── mongodb
190+
│ └── data
191+
├── mysql
192+
│ └── data
193+
└── redis
194+
├── config
195+
└── data
196+
```
197+
198+
199+
### III. Customizing OpenIM's Data Storage
200+
201+
**A. Setting a Custom Directory**
202+
203+
For organizations with specific storage directory requirements, OpenIM offers the flexibility to specify a custom directory. Follow these steps:
204+
205+
1. Define your custom directory path by setting the `DATA_DIR` environment variable:
206+
207+
```bash
208+
$ export DATA_DIR="/path/to/your/directory"
209+
```
210+
211+
1. Refresh OpenIM's configuration to reflect this change:
212+
213+
```bash
214+
$ make init
215+
```
216+
217+
**Note:** This action will update the configuration to point to the directory you've specified.
218+
219+
220+
### IV. Docker Volume Storage: An Advanced Approach
221+
222+
**A. Why Docker Volumes?**
223+
224+
Docker volumes offer isolated storage solutions, optimizing data persistence and performance. When scaling services in Docker, using volumes ensures that data remains consistent and protected.
225+
226+
**B. Using Docker Volumes with OpenIM**
227+
228+
To launch OpenIM with Docker volume support, execute:
229+
230+
```bash
231+
$ docker compose -f example/volume-all-server.yml up -d
232+
```
233+
234+
With this setup, your OpenIM data is securely mounted onto Docker's volumes, providing added resilience and scalability.
235+
236+
**C. Managing Docker Volumes**
237+
238+
1. **Listing OpenIM Docker Volumes**
239+
240+
Retrieve a list of Docker volumes associated with OpenIM using:
241+
242+
```bash
243+
$ docker volume ls | grep open-im-server
244+
```
245+
246+
1. **Removing Data**
247+
248+
- For **locally mapped data**: Simply navigate to the appropriate directory and delete the desired files or folders.
249+
- For **Docker volume data**: If you wish to clear data from Docker volumes, employ the command below:
250+
251+
```bash
252+
$ docker volume ls | grep open-im-server | awk '{print $2}' | xargs docker volume rm
253+
```
254+
255+
**Warning:** This action will permanently erase the data. Always ensure you have backups before proceeding.
256+
257+
145258
### Custom Startup
146259

147260
Based on your requirements, choose the appropriate Docker-compose file to start:
@@ -237,6 +350,12 @@ Ensure your Docker and Docker Compose are up-to-date to guarantee the best compa
237350

238351
We encourage community contributions and improvements to this project. For the specific contribution process, please refer to [CONTRIBUTING.md](https://chat.openai.com/CONTRIBUTING.md).
239352

353+
### Conclusion
354+
355+
OpenIM's flexible storage solutions empower organizations to configure their infrastructure in alignment with their specific needs. Whether through default directories, custom paths, or Docker volumes, OpenIM guarantees efficient and secure data management.
356+
357+
For further assistance or advanced configurations, please consult our technical support team or refer to OpenIM's comprehensive documentation.
358+
240359
## License
241360

242361
This project uses the MIT license. For details, please refer to [LICENSE](https://chat.openai.com/LICENSE).

0 commit comments

Comments
 (0)