From 020ebd1f17bc4ade4b67ddf157bafc75eeb8990d Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 8 Apr 2019 20:18:18 +0900 Subject: [PATCH] Updated Dockerfile --- Dockerfile | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b9c79460..5ff8cf67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,26 @@ +# Development 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 git nodejs npm make gcc libc-dev +RUN apk add --no-cache git nodejs npm make gcc libc-dev RUN npm i -g typescript -RUN go mod download -RUN make tools && make assets -RUN GOOS=linux go build RUN git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn +ENV GO111MODULE=on +RUN go install github.com/aerogo/pack && \ + go install github.com/aerogo/run && \ + go install golang.org/x/tools/cmd/goimports +RUN mkdir /notify.moe +ADD go.mod go.sum /notify.moe/ +WORKDIR /notify.moe +RUN go mod download +ADD . /notify.moe +RUN tsc && \ + pack && \ + GOOS=linux go build +# Production FROM alpine:latest as production +RUN apk add ca-certificates COPY --from=builder /root/.aero /root/.aero COPY --from=builder /notify.moe /notify.moe +ENV ARN_ROOT=/notify.moe WORKDIR /notify.moe CMD ["./notify.moe"] \ No newline at end of file