add Dockerfile
This commit is contained in:
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -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"]
|
||||||
Reference in New Issue
Block a user