mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 00:55:59 +08:00
Tuoyun 新增单容器单进程的部署方式 (#103)
* feat 新增deploy:单容器单进程模型部署 * feat 新增openim内部各组件的host名称配置; fix 独立容器部署镜像文档; * feat 新增注释说明
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user