From fc0e774ef59c7b433cc376f3adce17f4a2f2f432 Mon Sep 17 00:00:00 2001 From: XOF Date: Sat, 27 Dec 2025 18:27:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c129a8e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Dockerfile +FROM golang:1.21-alpine AS builder + +WORKDIR /build + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . +RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o GHub + +FROM alpine:latest + +WORKDIR /app + +COPY --from=builder /build/GHub . + +EXPOSE 18187 + +CMD ["./GHub", "-l", "0.0.0.0", "-p", "18187", "-ll", "info", "-w", "github.com"]