-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from deep-stack/pm-image-migrations
Update Dockerfile to run migrations
- Loading branch information
Showing
6 changed files
with
101 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
FROM timescale/timescaledb:latest-pg14 | ||
FROM golang:1.16-alpine as builder | ||
|
||
COPY ./schema.sql /docker-entrypoint-initdb.d/init.sql | ||
RUN apk --update --no-cache add make git g++ linux-headers | ||
|
||
ADD . /go/src/github.com/vulcanize/ipld-eth-db | ||
|
||
# Build migration tool | ||
WORKDIR /go/src/github.com/pressly | ||
RUN git clone https://github.com/pressly/goose.git | ||
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_sqlite3' -o goose . | ||
|
||
# app container | ||
FROM alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/scripts/startup_script.sh . | ||
|
||
# copy over files for multi-node setup | ||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/docker-compose.test.yml docker-multi-node/docker-compose.test.yml | ||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/scripts/init-access-node.sh docker-multi-node/scripts/init-access-node.sh | ||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/scripts/init-data-node.sh docker-multi-node/scripts/init-data-node.sh | ||
|
||
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose | ||
COPY --from=builder /go/src/github.com/vulcanize/ipld-eth-db/db/migrations migrations/vulcanizedb | ||
|
||
ENTRYPOINT ["/app/startup_script.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters