refactor: Dockerfile.go

This commit is contained in:
2026-08-04 21:18:20 +08:00
parent 09e637584f
commit dfda597159
+25
View File
@@ -0,0 +1,25 @@
# Build stage
FROM golang:1.25-alpine AS build
# 设置国内 Go 代理
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /src
# Copy client library
COPY kenaito-conf-go-client/ ./kenaito-conf-go-client/
# Copy demo project
COPY kenaito-conf-go-client-demo/ ./kenaito-conf-go-client-demo/
# Build
WORKDIR /src/kenaito-conf-go-client-demo
RUN go mod tidy && go build -o /app/demo .
# Runtime stage
FROM alpine:3.20
WORKDIR /app
COPY --from=build /app/demo .
ENTRYPOINT ["./demo"]