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
1.2 KiB

  1. # Use Go 1.10
  2. FROM golang:1.10
  3. # Load repository into docker
  4. WORKDIR /go/src/git.aiterp.net/rpdata/api/
  5. COPY . .
  6. # Load build tools and dependencies
  7. RUN go get -u github.com/golang/dep/cmd/dep
  8. RUN go get -u github.com/jteeuwen/go-bindata/...
  9. RUN dep ensure
  10. RUN go generate ./...
  11. # Build server and tools (CGO disabled to make them 100% static)
  12. ENV CGO_ENABLED 0
  13. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-graphiql ./cmd/rpdata-graphiql
  14. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-lb2charimport ./cmd/rpdata-lb2charimport
  15. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-lb2logimport ./cmd/rpdata-lb2logimport
  16. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-wikifileimport ./cmd/rpdata-wikifileimport
  17. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-ensurechannels ./cmd/rpdata-ensurechannels
  18. RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-as2storyimport ./cmd/rpdata-as2storyimport
  19. # Move artifacts into final container
  20. FROM alpine:latest
  21. RUN apk add --no-cache ca-certificates
  22. COPY --from=0 /binaries/* /usr/local/bin/
  23. CMD ["/usr/local/bin/rpdata-graphiql"]