From 9e7a3adbdfcf7c34e160fbcc14af8cc1206c0b50 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 8 Apr 2019 19:16:59 +0900 Subject: [PATCH] Updated dockerfile --- Dockerfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d206788..b9c79460 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file + +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"] \ No newline at end of file