DEV Community

skiffer-git
skiffer-git

Posted on

Deploy OpenIM using Docker

🌟 Environment Requirements

Considerations Details
Operating System Linux, ideally Ubuntu 22.04, root user
Hardware Resources At least 4GB RAM, for user volume <100,000, single machine deployment: 8C 16G 10Mb 1T regular disk
golang 1.18 and above
docker Docker version 24.0.5, build ced0996 or newer
git 2.17.1 and above

πŸ“¦ Storage Component Requirements

Storage Component Recommended Version
mongodb 6.0.2 and above
redis 7.0.0 and above
zookeeper latest
kafka latest
mysql 5.7 and above
minio latest

πŸ›  1. Set Common Environment Variables

  • CHAT_BRANCH

    • Description: chat version
    • Default: release-v1.3
    • Consideration: Supports version 1.3 and above
    export CHAT_BRANCH="release-v1.3"
    
  • SERVER_BRANCH

    • Description: OpenIMServer version
    • Default: release-v3.3
    • Consideration: Supports version 3.3 and above
    export SERVER_BRANCH="release-v3.3"
    
  • PASSWORD

    • Description: Component password (mysql/mongodb/redis/minio)
    • Default: openIM123
    • Consideration: Password should be β‰₯8 characters and without special characters
    export PASSWORD="openIM123"
    
  • USER

    • Description: Component username (mysql/mongodb/redis/minio)
    • Default: root
    export USER="root"
    
  • API_URL

    • Description: API address
    • Note: Automatically fetched if there's an external IP; for internal network, set it to the server IP
    export API_URL="http://ip:10002"
    
  • DATA_DIR

    • Description: Data volume directory
    • Default: ./
    export DATA_DIR="./"
    


πŸ›  More Environment Variables

🟒 For a detailed understanding of various environment variables, please refer to this document.

⚠️ Note: Variables set using export have higher priority than the ones in the script.


πŸš€ 2. Pull and Launch Image

git clone https://github.com/openim-sigs/openim-docker openim/openim-docker && export openim=$(pwd)/openim && cd $openim/openim-docker && make init && docker compose up -d
Enter fullscreen mode Exit fullscreen mode

🟒 If your docker doesn't support compose, it's recommended to upgrade following this guide.

πŸ“œ View Logs

docker compose logs openim-server
docker compose logs openim-chat
Enter fullscreen mode Exit fullscreen mode

🟒 More logs can be found at: openim-server/branch/logs/ and openim-chat/branch/logs

🩺 Check Health Status

docker ps
Enter fullscreen mode Exit fullscreen mode

docker-ps

3. Quick Verification

Please refer to the Quick Verification document.

❓ Frequently Asked Questions 🧐


1. How to modify using external components? πŸ› οΈ

Example: Using external mysqlπŸ”—:

  • πŸ“ Edit docker-compose.yaml and comment out mysql configuration and its corresponding depends_on.
  • πŸ“ Edit scripts/install/environment.sh and change the mysql configuration.
  • πŸ’» Run the command: make init
  • πŸš€ Run the command: docker compose up -d

2. Health status is starting? 🟠

Initially, before the health check, Docker's default status is starting⏳. Approximately after 1 minute, the status changes to healthyβœ….


3. Port Mapping 🌐

Docker networks allow for user-defined settingsπŸ”§. You can map ports as usualπŸ”€.


4. About Docker Version πŸ‹

The new version of Docker has integrated docker-compose. Older versions of Docker might not support the gateway feature❌. It's recommended to upgrade to a newer version, such as 23.0.1πŸ”.


About OpenIM

Open source, and universal instant messaging components

OpenIM includes server and client SDKs, achieving high performance, lightweight, and easy-to-extend features. Developers can integrate instant messaging and real-time networking capabilities quickly into their applications by integrating the OpenIM SDK and deploying the server privately, ensuring the security and privacy of business data.

Currently, the github star is over 12,000, including iOS, Android, Flutter, ReactNative, web, pc, and Uniapp platforms.

GitHub: https://github.com/openimsdk/open-im-server
Official Website: https://docs.openim.io/

Image description

Top comments (0)