# build stage
ARG go_version=latest
FROM golang:$go_version as build
WORKDIR $GOPATH/src/code.justin.tv/cb/secretshop
COPY Makefile .
# Copy over everything else required for the build.
COPY . .
RUN make build

# final stage
FROM alpine:3.8
ARG app_port
ARG debug_port
RUN apk --no-cache add ca-certificates
COPY --from=build /go/src/code.justin.tv/cb/secretshop/build/secretshop .
COPY --from=build /go/src/code.justin.tv/cb/secretshop/config config
ENTRYPOINT ["/secretshop"]
