Updated dockerfile

This commit is contained in:
Eduard Urbach 2019-04-08 19:16:59 +09:00
parent 25fdd9dfaa
commit 9e7a3adbdf

View File

@ -1,13 +1,17 @@
FROM golang:1.12.2-alpine
FROM golang:1.12.2-alpine as builder
RUN mkdir /notify.moe
ADD . /notify.moe
WORKDIR /notify.moe
ENV ARN_ROOT /notify.moe
RUN apk add --no-cache git nodejs npm make gcc libc-dev
RUN apk add git nodejs npm make gcc libc-dev
RUN npm i -g typescript
RUN go mod download
RUN make tools && make assets
RUN make server
RUN GOOS=linux go build
RUN git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
RUN apk del git nodejs npm make gcc libc-dev
CMD ["/notify.moe/notify.moe"]
FROM alpine:latest as production
COPY --from=builder /root/.aero /root/.aero
COPY --from=builder /notify.moe /notify.moe
WORKDIR /notify.moe
CMD ["./notify.moe"]