From 3bd6012b7e9f42851e6dd68740ce3421548f9fb7 Mon Sep 17 00:00:00 2001 From: rare-magma Date: Sat, 17 Feb 2024 11:18:39 +0100 Subject: [PATCH] build: add dockerfile Signed-off-by: rare-magma --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b7ddcb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM docker.io/library/golang:1.17-alpine as builder + +ARG GIT_COMMIT +ENV GIT_COMMIT=$GIT_COMMIT +ENV CGO_ENABLED=0 + +WORKDIR /app + +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . +RUN go build -v -ldflags "-s -w -X main.version=$GIT_COMMIT" -trimpath -o ./build/kepubify ./cmd/kepubify + +FROM scratch + +COPY --from=builder /app/build/kepubify /opt/kepubify + +ENTRYPOINT ["/opt/kepubify"] \ No newline at end of file