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.

29 lines
907 B

  1. ## 1. Build Server
  2. # Use Go 1.14
  3. FROM golang:1.16 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. RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-dump ./cmd/rpdata-dump
  13. RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-restore ./cmd/rpdata-restore
  14. ## 2. Distribute
  15. # Use alpine linux
  16. FROM alpine:3.13
  17. # Install certificates to enable HTTPS GET requests, and tzdata for log imports.
  18. RUN apk add --no-cache ca-certificates tzdata
  19. # Copy build files into final container
  20. COPY --from=build-server /binaries/* /usr/local/bin/
  21. # The server is the main entry point
  22. CMD ["/usr/local/bin/rpdata-server"]