<reponame>harshitandro/mongo-es-datasync
FROM golang:1.12.6-alpine3.9 as builder
MAINTAINER <EMAIL>

RUN mkdir /project \
 && apk add git

COPY src /project/src
COPY app_conf.json /project/app_conf.json

COPY go.mod /project/go.mod
COPY go.sum /project/go.sum
COPY main.go /project/main.go

RUN cd /project \
 && go mod download \
 && go mod verify \
 && go install -i



FROM alpine:3.9
MAINTAINER <EMAIL>

COPY --from=builder /go/bin/mongo-es-datasync /mongo-es-datasync
COPY --from=builder /project/app_conf.json /etc/mongo-es-sync/app_conf.json

CMD ["/mongo-es-datasync"]