2022-06-20 13:23:39 +00:00
|
|
|
FROM golang:1.18-alpine as builder
|
2021-10-09 11:13:16 +00:00
|
|
|
|
2022-05-10 10:45:57 +00:00
|
|
|
RUN apk --update --no-cache add make git g++ linux-headers
|
|
|
|
|
2022-09-14 05:04:54 +00:00
|
|
|
ADD . /go/src/github.com/cerc-io/ipld-eth-db
|
2022-05-10 10:45:57 +00:00
|
|
|
|
|
|
|
# Build migration tool
|
|
|
|
WORKDIR /go/src/github.com/pressly
|
2022-07-22 06:14:07 +00:00
|
|
|
ARG GOOSE_VER="v3.6.1"
|
|
|
|
RUN git clone --depth 1 --branch ${GOOSE_VER} https://github.com/pressly/goose.git
|
2022-05-10 10:45:57 +00:00
|
|
|
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
|
|
|
|
|
2022-09-14 05:04:54 +00:00
|
|
|
COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-db/scripts/startup_script.sh .
|
2022-05-10 10:45:57 +00:00
|
|
|
|
|
|
|
COPY --from=builder /go/src/github.com/pressly/goose/cmd/goose/goose goose
|
2022-09-14 05:04:54 +00:00
|
|
|
COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-db/db/migrations migrations/vulcanizedb
|
2022-05-10 10:45:57 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/app/startup_script.sh"]
|