Dockerfile 564 B

1234567891011121314151617181920
  1. FROM golang:latest as build-env
  2. RUN mkdir /app
  3. WORKDIR /app
  4. COPY go.mod .
  5. COPY go.sum .
  6. # Get dependencies - will also be cached if we won't change mod/sum
  7. RUN go mod download
  8. # COPY the source code as the last step
  9. COPY . .
  10. # Build the binary
  11. RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o /go/bin/app
  12. FROM alpine:3.4
  13. RUN apk add --update --no-cache ca-certificates git
  14. COPY --from=build-env /go/bin/app /go/bin/app
  15. ADD ./cloud/default.json /models/default.json
  16. ADD ./cloud/azure.json /models/azure.json
  17. ENTRYPOINT ["/go/bin/app"]