diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..01c7726c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,18 @@ +.git +.travis.yml +.idea +bin +db +.gitignore +environments +integration_test +LICENSE +postgraphile +.private_blockchain_password +README.md +scripts +Supfile +test_config +.travis.yml +vulcanizedb.log + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f749245e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:alpine as builder +RUN apk --update --no-cache add make git g++ + +# Build statically linked vDB binary (wonky path because of Dep) +RUN mkdir -p /go/src/github.com/vulcanize/vulcanizedb +ADD . /go/src/github.com/vulcanize/vulcanizedb +WORKDIR /go/src/github.com/vulcanize/vulcanizedb +RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' . + +# Second stage +FROM scratch +COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/vulcanizedb /app/vulcanizedb +WORKDIR /app +CMD ["./vulcanizedb", "--help"]