forked from cerc-io/ipld-eth-server
Dockerize migrations
This commit is contained in:
parent
d3550357d1
commit
1602100ed4
@ -2,7 +2,6 @@
|
|||||||
.travis.yml
|
.travis.yml
|
||||||
.idea
|
.idea
|
||||||
bin
|
bin
|
||||||
db
|
|
||||||
.gitignore
|
.gitignore
|
||||||
environments
|
environments
|
||||||
integration_test
|
integration_test
|
||||||
@ -15,4 +14,5 @@ Supfile
|
|||||||
test_config
|
test_config
|
||||||
.travis.yml
|
.travis.yml
|
||||||
vulcanizedb.log
|
vulcanizedb.log
|
||||||
|
Dockerfile
|
||||||
|
|
||||||
|
11
Dockerfile
11
Dockerfile
@ -7,8 +7,15 @@ ADD . /go/src/github.com/vulcanize/vulcanizedb
|
|||||||
WORKDIR /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"' .
|
RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' .
|
||||||
|
|
||||||
|
# Build migration tool
|
||||||
|
RUN go get -u -d github.com/pressly/goose/cmd/goose
|
||||||
|
WORKDIR /go/src/github.com/pressly/goose/cmd/goose
|
||||||
|
RUN GCO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -tags='no_mysql no_sqlite' -o goose
|
||||||
|
|
||||||
# Second stage
|
# Second stage
|
||||||
FROM scratch
|
FROM alpine
|
||||||
COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/vulcanizedb /app/vulcanizedb
|
COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/vulcanizedb /app/vulcanizedb
|
||||||
|
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose /app/goose
|
||||||
|
COPY --from=builder /go/src/github.com/vulcanize/vulcanizedb/db/migrations/* /app/
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
CMD ["./vulcanizedb", "--help"]
|
CMD ["./goose"]
|
||||||
|
Loading…
Reference in New Issue
Block a user