Tuoyun 新增单容器单进程的部署方式 (#103)

* feat 新增deploy:单容器单进程模型部署

* feat 新增openim内部各组件的host名称配置;
fix 独立容器部署镜像文档;

* feat 新增注释说明
This commit is contained in:
itltf512116
2021-12-17 10:49:01 +08:00
committed by GitHub
parent a328080ba4
commit 7a6df3abd3
35 changed files with 1454 additions and 83 deletions
+16 -2
View File
@@ -1,10 +1,13 @@
package config
import (
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"github.com/spf13/viper"
"gopkg.in/yaml.v3"
)
var (
@@ -179,7 +182,18 @@ func init() {
//bytes, err := ioutil.ReadFile(path + "/config/config.yaml")
// if we cd Open-IM-Server/src/utils and run go test
// it will panic cannot find config/config.yaml
bytes, err := ioutil.ReadFile(Root + "/config/config.yaml")
cfgName := os.Getenv("CONFIG_NAME")
if len(cfgName) == 0 {
cfgName = Root + "/config/config.yaml"
}
viper.SetConfigFile(cfgName)
err := viper.ReadInConfig()
if err != nil {
panic(err.Error())
}
bytes, err := ioutil.ReadFile(cfgName)
if err != nil {
panic(err.Error())
}