From b86e5013fbb205ab0b95a27392c79bd5ca8046ee Mon Sep 17 00:00:00 2001 From: zzw <1464003642@qq.com> Date: Fri, 23 Oct 2026 15:02:03 +0800 Subject: [PATCH] chore: ws git cache --- services/ws/Dockerfile | 37 +++++++++++++++++++++++++++++++++++++ services/ws/etc/ws.yaml | 7 ------- services/ws/run.toml | 27 --------------------------- 3 files changed, 37 insertions(+), 34 deletions(-) create mode 100644 services/ws/Dockerfile delete mode 100644 services/ws/etc/ws.yaml delete mode 100644 services/ws/run.toml diff --git a/services/ws/Dockerfile b/services/ws/Dockerfile new file mode 100644 index 0000000..a64e57a --- /dev/null +++ b/services/ws/Dockerfile @@ -0,0 +1,37 @@ +FROM golang:1.26.5-alpine AS builder + +WORKDIR /src + +ENV GOPROXY=https://goproxy.cn,direct \ + CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 + +COPY pkg ./pkg +COPY go.mod go.sum ./ + +RUN --mount=type=cache,target=/go/pkg/mod \ + go mod download + +COPY rpc/ ./rpc +COPY services/ws/ ./services/ws/ + +WORKDIR /src/services/ws + +RUN --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/.cache/go-build \ + go build -ldflags="-s -w" -o /out/main ./ + +FROM alpine:3.22 + +WORKDIR /app + +ENV TZ=Asia/Shanghai + +RUN apk add --no-cache tzdata \ + && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ + && echo "Asia/Shanghai" > /etc/timezone + +COPY --from=builder /out/main . + +CMD ["./main", "-f", "etc/ws.yaml"] diff --git a/services/ws/etc/ws.yaml b/services/ws/etc/ws.yaml deleted file mode 100644 index 35ad868..0000000 --- a/services/ws/etc/ws.yaml +++ /dev/null @@ -1,7 +0,0 @@ -Nacos: - Hosts: - - rnacos:8848 - NamespaceId: test - Group: LONE_SERVICES - RegisterIP: ws - ConfigID: ws diff --git a/services/ws/run.toml b/services/ws/run.toml deleted file mode 100644 index 24adb45..0000000 --- a/services/ws/run.toml +++ /dev/null @@ -1,27 +0,0 @@ -[base] - name = "ws-service" - listenOn = "0.0.0.0:10002" - mode = "dev" - -[log] - path = "logs" - serviceName = "ws-service" - mode = "file" - encoding = "plain" - level = "info" - keepDays = 7 - maxSize = 50 - maxBackups = 5 - compress = false - -[redis] - host = '39.106.171.204' - password = 'lLMLcuPpzSj' - port = 6379 - db = 1 - -[log-redis] - host = '39.106.171.204' - password = 'lLMLcuPpzSj' - port = 6379 - db = 3 \ No newline at end of file