From 68981e9eb56b120ce5a5559759090002be3c3258 Mon Sep 17 00:00:00 2001 From: sirrow Date: Sun, 26 Oct 2025 16:53:07 +0900 Subject: [PATCH] add Dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ade1d61 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM golang:alpine AS build-env + +RUN apk --no-cache add git make build-base + +RUN git clone --depth 1 https://git.sirrow.work/sirrow/tweetdistributor.git +WORKDIR tweetdistributor + +RUN mkdir -p /build +RUN go mod tidy +RUN go build -a -tags "netgo" -tags timetzdata -installsuffix netgo -ldflags="-s -w -extldflags \"-static\"" -o=/build/tweetdistributor main.go + +FROM alpine:3.22 + +RUN apk --no-cache add ca-certificates +COPY --from=build-env /build/tweetdistributor /tweetdistributor +RUN chmod u+x /tweetdistributor + +CMD ["/tweetdistributor"] \ No newline at end of file