增加dockerfile配置

This commit is contained in:
2026-04-09 16:10:11 +08:00
parent 8eb992e658
commit 45e6bf653f

16
config/config.go Normal file
View 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))
}
}