From 0fde21c0ec53a3fe9f0d0eb24b9413783d53bfb5 Mon Sep 17 00:00:00 2001 From: lqyan Date: Tue, 5 Nov 2024 14:30:24 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=89=93=E5=8C=85):=20=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E4=BF=AE=E6=94=B9=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E6=89=93=E5=8C=85=E8=84=9A=E6=9C=AC=E7=9A=84=E7=BC=96=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- Dockerfile | 7 ++++++- build-client.bat | 2 ++ client/main.go | 2 +- go.mod | 4 ++-- server/main.go | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 build-client.bat diff --git a/.gitignore b/.gitignore index 6773729..90b22a5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ yuchat-proxy-server -yuchat-proxy-client.exe \ No newline at end of file +*.exe \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bef5da5..2720647 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ +from docker.yuchat.top/golang:1.21-alpine AS builder +workdir /app +COPY . . +RUN go mod tidy && go build -o yuchat-proxy-server server/main.go + from docker.yuchat.top/alpine:3.11 workdir /app expose 8080 -add yuchat-proxy-server /app +copy --from=builder /app/yuchat-proxy-server /app/yuchat-proxy-server entrypoint ["./yuchat-proxy-server"] \ No newline at end of file diff --git a/build-client.bat b/build-client.bat new file mode 100644 index 0000000..a4193ec --- /dev/null +++ b/build-client.bat @@ -0,0 +1,2 @@ +go mod tidy +go build -o yuchat-proxy-client.exe client/main.go \ No newline at end of file diff --git a/client/main.go b/client/main.go index 6e1c6d7..c1ba0b2 100644 --- a/client/main.go +++ b/client/main.go @@ -3,7 +3,7 @@ package main import ( "log" "net" - "test-proxy-go/common" + "yuchat-proxy/common" "github.com/gorilla/websocket" ) diff --git a/go.mod b/go.mod index b2e650a..b54a69f 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ -module test-proxy-go +module yuchat-proxy go 1.21.0 -require github.com/gorilla/websocket v1.5.3 // indirect +require github.com/gorilla/websocket v1.5.3 diff --git a/server/main.go b/server/main.go index ce19259..24e4cf6 100644 --- a/server/main.go +++ b/server/main.go @@ -6,7 +6,7 @@ import ( "log" "net" "net/http" - "test-proxy-go/common" + "yuchat-proxy/common" "github.com/gorilla/websocket" )