增加dockerfile配置
This commit is contained in:
16
config/config.go
Normal file
16
config/config.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcfg"
|
||||
"github.com/gogf/gf/v2/os/genv"
|
||||
)
|
||||
|
||||
func init() {
|
||||
env := genv.Get("APP_ENV", "").String()
|
||||
if env != "" {
|
||||
g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName(fmt.Sprintf("config-%s.yml", env))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user