The new logbot, not committed from the wrong terminal window this time.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
727 B

  1. ## 1. Build Server
  2. # Use Go 1.11
  3. FROM golang:1.11 AS build
  4. # Load repository into docker
  5. WORKDIR /go/src/git.aiterp.net/rpdata/logbot3/
  6. COPY . .
  7. RUN rm -rf ./vendor
  8. # Load and run dependencies
  9. RUN go get -u github.com/golang/dep/cmd/dep
  10. RUN dep ensure
  11. # Build server and tools (CGO disabled to make them 100% static)
  12. ENV CGO_ENABLED 0
  13. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/logbot3 .
  14. ## 2. Distribute
  15. # Use alpine linux
  16. FROM alpine:3.8 as main-dist
  17. # Install certificates to enable HTTPS GET requests
  18. RUN apk add --no-cache ca-certificates
  19. # Copy build files into final container
  20. COPY --from=build /binaries/* /usr/local/bin/
  21. # The server is the main entry point
  22. CMD ["/usr/local/bin/logbot3"]