Loggest thine Stuff
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.

24 lines
649 B

  1. ## 1. Build Server
  2. # Use Go 1.18
  3. FROM golang:1.18 AS build-server
  4. # Load repository into docker
  5. WORKDIR /project/
  6. COPY . .
  7. # Build server and tools (CGO disabled to make them 100% static)
  8. ENV CGO_ENABLED 0
  9. RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/stufflog3 ./cmd/stufflog3
  10. ## 2. Distribute
  11. # Use alpine linux
  12. FROM alpine:3.16
  13. # Install certificates to enable HTTPS GET requests, and tzdata for log imports.
  14. RUN apk add --no-cache ca-certificates tzdata
  15. # Copy build files into final container
  16. COPY --from=build-server /binaries/* /usr/local/bin/
  17. # The server is the main entry point
  18. CMD ["/usr/local/bin/stufflog3-local"]