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.

27 lines
625 B

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