diff --git a/Dockerfile b/Dockerfile index 7b4f955..a68ede2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,20 @@ -FROM golang:1.19-alpine +FROM golang:1.19-alpine as builder -ENV api_key="" +RUN apk --no-cache add git && export GOPRIVATE=github.com/houko/wechatgpt && \ + export GOPROXY=https://goproxy.cn,direct -RUN export GOPRIVATE=github.com/houko/wechatgpt +COPY . /root/build -WORKDIR /app - -COPY . /app +WORKDIR /root/build RUN go mod download && go build -o server main.go -CMD ./server \ No newline at end of file +FROM alpine:latest as prod + +RUN apk --no-cache add ca-certificates + +WORKDIR /root/ + +COPY --from=0 /root/build/server . + +CMD ["./server"] \ No newline at end of file diff --git a/config/config.go b/config/config.go index ec47b29..d1c933d 100644 --- a/config/config.go +++ b/config/config.go @@ -1,7 +1,6 @@ package config import ( - "fmt" "os" "strings" @@ -70,7 +69,6 @@ func GetWechatKeyword() *string { func GetTelegram() *string { tg := getEnv("telegram") - fmt.Println(tg) if tg != nil { return tg }