2018-03-10 18:19:16 +08:00
|
|
|
FROM golang:1.10-alpine as builder
|
2018-03-02 23:45:45 +08:00
|
|
|
|
2018-03-10 18:19:16 +08:00
|
|
|
RUN apk update \
|
|
|
|
&& apk --no-cache add git build-base
|
|
|
|
|
|
|
|
WORKDIR /go/src/github.com/RadhiFadlillah/shiori
|
2018-03-02 23:45:45 +08:00
|
|
|
COPY . .
|
2018-03-10 18:19:16 +08:00
|
|
|
RUN go get -d -v ./...
|
|
|
|
RUN go build -o shiori main.go
|
|
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
ENV ENV_SHIORI_DB /srv/shiori.db
|
2018-03-02 23:45:45 +08:00
|
|
|
|
2018-03-10 18:19:16 +08:00
|
|
|
RUN apk --no-cache add dumb-init ca-certificates
|
|
|
|
COPY --from=builder /go/src/github.com/RadhiFadlillah/shiori/shiori /usr/local/bin/shiori
|
|
|
|
|
|
|
|
WORKDIR /srv/
|
|
|
|
RUN touch shiori.db
|
2018-03-02 23:45:45 +08:00
|
|
|
|
2018-03-03 00:00:30 +08:00
|
|
|
EXPOSE 8080
|
|
|
|
|
2018-03-10 18:19:16 +08:00
|
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
|
|
CMD ["/usr/local/bin/shiori", "serve"]
|
|
|
|
|