diff --git a/Dockerfile b/Dockerfile index ba09bf510..a6580b702 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,13 @@ -FROM golang:1.13-alpine as builder - -RUN apk update && apk --no-cache add git build-base -RUN go get -u -v github.com/go-shiori/shiori - -# ========== END OF BUILDER ========== # - -FROM alpine:latest - -RUN apk update && apk --no-cache add dumb-init ca-certificates -COPY --from=builder /go/bin/shiori /usr/local/bin/shiori - +# build stage +FROM golang:alpine AS builder +RUN apk add --no-cache build-base +WORKDIR /src +COPY . . +RUN go build + +# server image +FROM golang:alpine +COPY --from=builder /src/shiori /usr/local/bin/ ENV SHIORI_DIR /srv/shiori/ EXPOSE 8080 - -ENTRYPOINT ["/usr/bin/dumb-init", "--"] -CMD ["/usr/local/bin/shiori", "serve"] \ No newline at end of file +CMD ["/usr/local/bin/shiori", "serve"]