GraphQL API and utilities for the rpdata project
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
717 B

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