fix: ci dir error

This commit is contained in:
zzw
2026-08-21 14:59:08 +08:00
parent 5034aeeaf7
commit 0e76d6dfca
25 changed files with 1860 additions and 469 deletions
+39
View File
@@ -0,0 +1,39 @@
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/ad/ ./rpc/ad/
COPY services/ad/ ./services/ad/
WORKDIR /src/services/ad
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 .
EXPOSE 10400
CMD ["./main", "-f", "etc/ad.yaml"]