From c76f08ce4780b93b2450e48705e3f2d93ba63f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=97=8D+85CD?= <50108258+kwaa@users.noreply.github.com> Date: Sat, 21 Dec 2024 12:16:57 +0800 Subject: [PATCH] feat: add dockerfile --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7018364 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM golang:1.23 AS builder + +ARG TARGETOS +ARG TARGETARCH + +WORKDIR /app + +COPY go.mod go.sum ./ + +RUN go mod download + +COPY . . + +RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -o ./result/unspeech ./cmd/unspeech + +FROM gcr.io/distroless/static-debian12 AS app + +COPY --from=builder /app/result/unspeech / + +ENTRYPOINT ["/unspeech"]