From 7b0fb5f863929893079977c01e0d95a1773628cd Mon Sep 17 00:00:00 2001 From: walker Date: Mon, 7 Aug 2023 18:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=20=E4=BF=AE=E6=94=B9Dockerfile=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +--- xiannccda.setting.yml => config.yml | 0 config/config.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) rename xiannccda.setting.yml => config.yml (100%) diff --git a/Dockerfile b/Dockerfile index 354e970..b806d54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,9 @@ FROM golang:1.20.7 as builder WORKDIR /go/src/joylink.club/bj-rtsts-server COPY . ./ -RUN pwd && ls -l RUN go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct && go build -o bj-rtsts-server - FROM scratch WORKDIR /bj-rtsts -COPY --from=builder /go/src/joylink.club/bj-rtsts-server/bj-rtsts-server . +COPY --from=builder /go/src/joylink.club/bj-rtsts-server/bj-rtsts-server /go/src/joylink.club/bj-rtsts-server/config.yml ./ CMD [ "bj-rtsts-server" ] \ No newline at end of file diff --git a/xiannccda.setting.yml b/config.yml similarity index 100% rename from xiannccda.setting.yml rename to config.yml diff --git a/config/config.go b/config/config.go index 2f31b93..02a90b4 100644 --- a/config/config.go +++ b/config/config.go @@ -53,7 +53,7 @@ var Config AppConfig // 加载配置 func LoadConfig() { - viper.SetConfigName("xiannccda.setting") + viper.SetConfigName("config") viper.SetConfigType("yml") viper.AddConfigPath("./config/") viper.AddConfigPath(".")