Skip to content

Instantly share code, notes, and snippets.

@mosluce
Last active January 23, 2018 06:11
Show Gist options
  • Save mosluce/85ecd31ff994d48a651d2da289feb5a2 to your computer and use it in GitHub Desktop.
Save mosluce/85ecd31ff994d48a651d2da289feb5a2 to your computer and use it in GitHub Desktop.
# build stage
FROM golang:alpine AS build-env
RUN apk add --no-cache git bzr gcc musl-dev
RUN mkdir -p /go/src/klcc/auth
WORKDIR /go/src/klcc/auth
COPY . .
RUN go get -u github.com/kardianos/govendor
RUN govendor fetch -v +missing
RUN govendor install
# RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o app
RUN go build -o app
# bundle stage
FROM alpine
WORKDIR /app
COPY --from=build-env /go/src/klcc/auth/app /app/
ENV GO_ENV=development
ENV PORT=8080
EXPOSE 8080
ENTRYPOINT ./app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment