chore: sync local updates

This commit is contained in:
2026-05-16 19:03:34 +08:00
parent 9c086c3301
commit 80cf54a201
89 changed files with 10622 additions and 2443 deletions

View File

@@ -0,0 +1,21 @@
# 中心服务HTTP/WebSocket + gRPC纯 Go / modernc SQLiteCGO_ENABLED=0
# 镜像内进程为明文 HTTPHTTPS 请在宿主机 Nginx 等反代层配置,内网直连本端口即可。
FROM golang:1.22-alpine AS build
WORKDIR /src
RUN apk add --no-cache git
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /central .
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
# 与 config 默认一致; compose 中可覆盖
ENV HOST=0.0.0.0
ENV PORT=9393
ENV GRPC_PORT=9394
ENV DB_PATH=/app/data/servers.db
COPY --from=build /central /app/central
EXPOSE 9393 9394
ENTRYPOINT ["/app/central"]