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