################ DEV IMAGE ################
FROM golang:1.12.5-alpine3.9 as dev

RUN apk update && apk upgrade && \
    apk add --no-cache git

RUN go get github.com/sirupsen/logrus
RUN go get github.com/buaazp/fasthttprouter
RUN go get github.com/valyala/fasthttp

WORKDIR /work
COPY ./src /work/
RUN go build -o app

################## PROD IMAGE #################
FROM alpine:3.9 as prod
COPY --from=dev /work/app /
CMD ./app