添加 Dockerfile 以及测试环境脚本;docker 脚本复用环境变量

This commit is contained in:
2025-04-03 17:04:31 +08:00
parent 9d8850aec1
commit 67d82c4308
4 changed files with 57 additions and 5 deletions

4
pkg/env/env.go vendored
View File

@@ -13,7 +13,7 @@ import (
var (
AppName = "platform"
AppPort = "8080"
AppPort string
)
func loadApp() {
@@ -25,6 +25,8 @@ func loadApp() {
_AppPort := os.Getenv("APP_PORT")
if _AppPort != "" {
AppPort = _AppPort
} else {
panic("环境变量 APP_PORT 的值不能为空")
}
}