Browse Source

docker: Trimmed down DockerFile.

module-madness-pointers
Gisle Aune 6 years ago
parent
commit
852030b141
  1. 18
      Dockerfile
  2. 3
      Gopkg.toml

18
Dockerfile

@ -7,28 +7,26 @@ WORKDIR /go/src/git.aiterp.net/rpdata/api/
COPY . . COPY . .
RUN rm -rf ./vendor RUN rm -rf ./vendor
# Load build tools and dependencies
# Install build tools and dependencies
RUN go get -u github.com/golang/dep/cmd/dep RUN go get -u github.com/golang/dep/cmd/dep
RUN go get -u github.com/vektah/gorunpkg RUN go get -u github.com/vektah/gorunpkg
RUN go get -u github.com/jteeuwen/go-bindata/...
RUN dep ensure RUN dep ensure
RUN go generate ./... RUN go generate ./...
# Build server and tools (CGO disabled to make them 100% static) # Build server and tools (CGO disabled to make them 100% static)
ENV CGO_ENABLED 0 ENV CGO_ENABLED 0
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-server ./cmd/rpdata-server
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-lb2charimport ./cmd/rpdata-lb2charimport
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-lb2logimport ./cmd/rpdata-lb2logimport
# TODO: RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-wikifileimport ./cmd/rpdata-wikifileimport
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-ensurechannels ./cmd/rpdata-ensurechannels
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-as2storyimport ./cmd/rpdata-as2storyimport
RUN go build -a -installsuffix cgo -ldflags="-s -w" -o /binaries/rpdata-logpaste ./cmd/rpdata-logpaste
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 ## 2. Distribute
# Use alpine linux # Use alpine linux
FROM alpine:3.7 FROM alpine:3.7
# Install certificates to enable HTTPS GET requests, and tzdata for logpaste
# Install certificates to enable HTTPS GET requests, and tzdata for log imports.
RUN apk add --no-cache ca-certificates tzdata RUN apk add --no-cache ca-certificates tzdata
# Copy build files into final container # Copy build files into final container

3
Gopkg.toml

@ -38,9 +38,6 @@ required = [ "github.com/99designs/gqlgen" ]
go-tests = true go-tests = true
unused-packages = true unused-packages = true
[[constraint]]
branch = "master"
name = "github.com/graph-gophers/graphql-go"
[[constraint]] [[constraint]]
name = "github.com/stretchr/testify" name = "github.com/stretchr/testify"
version = "1.2.2" version = "1.2.2"
Loading…
Cancel
Save