FROM golang:alpine as gobuild

RUN apk add --no-cache git

WORKDIR /go/src/login-validator

ADD cmd ./

RUN go get -d -v
RUN go build -v


FROM alpine
MAINTAINER Pierre-Olivier Mercier <nemunaire@nemunai.re>

EXPOSE 8081

COPY --from=gobuild /go/src/login-validator/login-validator /bin/login-validator

ENTRYPOINT ["/bin/login-validator", "-bind=:8081"]

LABEL org.mobyproject.config='{"capabilities": ["CAP_NET_BIND_SERVICE"]}'
