From 025f2306a304894515b327c118fe0224e5e62dd6 Mon Sep 17 00:00:00 2001 From: sunrise <575563079@qq.com> Date: Fri, 10 Feb 2023 04:25:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9Dockerfile,=E4=BD=BF?= =?UTF-8?q?=E5=BE=97=E6=9E=84=E5=BB=BA=E5=87=BA=E7=9A=84docker=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E4=BB=85=E4=B8=BA17.4M?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) 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 From 791003654aa8fe1f014ba7e0cc3b1ca182e02fbf Mon Sep 17 00:00:00 2001 From: sunrise <575563079@qq.com> Date: Fri, 10 Feb 2023 04:39:20 +0800 Subject: [PATCH 2/2] remove fmt.Println() from GetTelegram config --- config/config.go | 2 -- 1 file changed, 2 deletions(-) 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 }