feat: automated deployment script

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/437/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 04264ae2e1
commit cbb4d7f5ea

@ -1,4 +1,4 @@
USER=root USER=root
PASSWORD=openIM123 PASSWORD=openIM123
MINIO_ENDPOINT=http://127.0.0.1:10005 MINIO_ENDPOINT=http://113.90.81.237:10005
DATA_DIR=./ DATA_DIR=./

@ -1,19 +1,19 @@
etcd: etcd:
userName: userName:
password: password:
secret: openIM123 # etcd 配置密钥 secret:
mysql: mysql:
dbMysqlUserName: root #mysql用户名 dbMysqlUserName: root
dbMysqlPassword: openIM123 # mysql密码 dbMysqlPassword:
mongo: mongo:
dbUserName: root #mongo用户名 dbUserName: root
dbPassword: openIM123 #mongo密码 dbPassword:
redis: redis:
dbUserName: dbUserName:
dbPassWord: openIM123 #redis密码 dbPassWord:
kafka: kafka:
SASLUserName: SASLUserName:
@ -21,11 +21,11 @@ kafka:
credential: credential:
minio: minio:
endpoint: http://127.0.0.1:10005 #发图片视频文件需要填写 endpoint:
accessKeyID: root accessKeyID: root
secretAccessKey: openIM123 secretAccessKey:
secret: tuoyun #建议修改 secret:
tokenpolicy: tokenpolicy:
accessSecret: "open_im_server" #token生成相关 建议修改 accessSecret: "open_im_server" #token生成相关 建议修改

@ -4,7 +4,7 @@ etcd:
etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可 etcdAddr: [ 127.0.0.1:2379 ] #单机部署时,默认即可
userName: userName:
password: password:
secret: openIM123 secret:
mysql: mysql:
dbMysqlDatabaseName: admin_chat # 数据库名字 默认即可 dbMysqlDatabaseName: admin_chat # 数据库名字 默认即可

@ -1,19 +1,43 @@
#!/usr/bin/env bash #!/usr/bin/env bash
internet_ip=`curl ifconfig.me -s`
echo $internet_ip
# Get the external IP address
internet_ip=$(curl -s ifconfig.me)
# Print the IP address
echo "Internet IP address: ${internet_ip}"
# Read environment variables
source .env source .env
echo $MINIO_ENDPOINT
if [ $MINIO_ENDPOINT == "http://127.0.0.1:10005" ]; then
sed -i "s/127.0.0.1/${internet_ip}/" .env
# Check if MINIO_ENDPOINT variable is set correctly
if [[ -z "${MINIO_ENDPOINT}" || "${MINIO_ENDPOINT}" != "http://127.0.0.1:10005" ]]; then
echo "Error: MINIO_ENDPOINT is not set or is not equal to http://127.0.0.1:10005."
exit 1
fi fi
cd script ; # Replace the IP address in the .env file
chmod +x *.sh ; sed -i "s/127.0.0.1/${internet_ip}/" .env
# Enter the script directory
cd script || exit 1
# Add execute permission to scripts
chmod +x *.sh
# Initialize password
./init_pwd.sh ./init_pwd.sh
./env_check.sh;
cd .. ; # Check environment variables
docker-compose up -d; ./env_check.sh
cd script ;
# Return to the parent directory
cd ..
# Start docker containers
docker-compose up -d
# Enter the script directory
cd script || exit 1
# Check if docker services are running properly
./docker_check_service.sh ./docker_check_service.sh

Loading…
Cancel
Save