feat: user items

This commit is contained in:
zzw
2026-08-14 17:53:41 +08:00
parent 2cd2a5f6ff
commit beb17a141b
12 changed files with 567 additions and 18 deletions
+38
View File
@@ -0,0 +1,38 @@
# syntax=docker/dockerfile:1
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 user/go.mod user/go.sum ./user/
WORKDIR /src/user
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY user/ ./
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -ldflags="-s -w" -o /out/user .
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/user .
EXPOSE 10300
CMD ["./user", "-f", "etc/user.yaml"]