the build was successful
gqlgen Squashed commit of the following: commit162ccf6bfbAuthor: Gisle Aune <dev@gisle.me> Date: Fri May 17 11:51:23 2019 +0200 The great module madness continus, now with pointers. commit7e3dc49635Author: Gisle Aune <dev@gisle.me> Date: Thu May 16 15:57:08 2019 +0200 Basic stuff, doesn't compile
33 lines
1.2 KiB
Docker
33 lines
1.2 KiB
Docker
## 1. Build Server
|
|
# Use Go 1.12
|
|
FROM golang:1.12 AS build-server
|
|
|
|
# Load repository into docker
|
|
WORKDIR /project/
|
|
COPY . .
|
|
|
|
# Install build tools and dependencies
|
|
RUN go generate ./...
|
|
|
|
# Build server and tools (CGO disabled to make them 100% static)
|
|
ENV CGO_ENABLED 0
|
|
RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-server ./cmd/rpdata-server
|
|
RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-lb2charimport ./cmd/rpdata-lb2charimport
|
|
RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-lb2logimport ./cmd/rpdata-lb2logimport
|
|
# TODO: RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-wikifileimport ./cmd/rpdata-wikifileimport
|
|
RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-ensurechannels ./cmd/rpdata-ensurechannels
|
|
RUN go build -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-as2storyimport ./cmd/rpdata-as2storyimport
|
|
|
|
## 2. Distribute
|
|
# Use alpine linux
|
|
FROM alpine:3.7
|
|
|
|
# Install certificates to enable HTTPS GET requests, and tzdata for log imports.
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
# Copy build files into final container
|
|
COPY --from=build-server /binaries/* /usr/local/bin/
|
|
|
|
# The server is the main entry point
|
|
CMD ["/usr/local/bin/rpdata-server"]
|