chore: bind sensitive config to env vars and bump Go image to 1.25

- bind postgres.password to POSTGRES_PASSWORD env var via viper BindEnv
  - bind service.secret_key to SERVICE_SECRET_KEY env var via viper BindEnv
  - upgrade builder base image from golang:1.24-alpine to golang:1.25-alpine
This commit is contained in:
douxu 2026-05-29 10:56:17 +08:00
parent 9c4dcd29e4
commit bacd43617e
2 changed files with 4 additions and 1 deletions

View File

@ -145,6 +145,9 @@ func ReadAndInitConfig(configDir, configName, configType string) (modelRTConfig
panic(err)
}
config.BindEnv("postgres.password", "POSTGRES_PASSWORD")
config.BindEnv("service.secret_key", "SERVICE_SECRET_KEY")
if err := config.Unmarshal(&modelRTConfig); err != nil {
panic(fmt.Sprintf("unmarshal modelRT config failed:%s\n", err.Error()))
}

View File

@ -1,4 +1,4 @@
FROM golang:1.24-alpine AS builder
FROM golang:1.25-alpine AS builder
RUN apk --no-cache upgrade
WORKDIR /app