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.

32 lines
1.2 KiB

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