FROM golang:1.13.3
RUN curl -s -o /wait-for-it.sh https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh && chmod 777 /wait-for-it.sh
WORKDIR /go/src/code.justin.tv/eventbus/controlplane
RUN go get -u -d github.com/golang-migrate/migrate/cli github.com/lib/pq github.com/hashicorp/go-multierror
RUN go build -tags 'postgres' -o /usr/local/bin/migrate github.com/golang-migrate/migrate/cli
ENTRYPOINT [ "/wait-for-it.sh", "eventbus-db-test:5432", "--timeout=60", "--strict", "--" ]
