Add initial dockerfile and .dockerignore

This commit is contained in:
Edvard 2019-01-21 11:17:39 +01:00
parent 219f099b0c
commit d3550357d1
2 changed files with 32 additions and 0 deletions

18
.dockerignore Normal file
View File

@ -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

14
Dockerfile Normal file
View File

@ -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"]