diff --git a/modules/config/config.go b/modules/config/config.go index cf9acbc..52b6680 100644 --- a/modules/config/config.go +++ b/modules/config/config.go @@ -41,11 +41,9 @@ func LoadConfig() { fmt.Println("Load env from system") } - Cfg = Config{ + config := Config{ Debug: os.Getenv("DEBUG") == "true", ColorizedOutput: os.Getenv("COLORIZED_OUTPUT") == "true", - Host: os.Getenv("HOST"), - Port: os.Getenv("PORT"), LogManagerServerUrl: os.Getenv("LOG_MANAGER_SERVER_URL"), Telegram: Telegram{ Debug: os.Getenv("TELEGRAM_DEBUG") == "true", @@ -59,4 +57,15 @@ func LoadConfig() { DatabaseName: os.Getenv("MARIADB_DATABASE_NAME"), }, } + + // load default values if not in docker + if os.Getenv("DOCKER") == "" { + config.Host = os.Getenv("HOST") + config.Port = os.Getenv("PORT") + } else { // load from docker env + config.Host = "0.0.0.0" + config.Port = "3000" + } + + Cfg = config }