2022-06-20 13:23:39 +00:00
|
|
|
FROM golang:1.18-alpine as builder
|
2021-10-09 11:13:16 +00:00
|
|
|
|
2023-03-13 13:38:00 +00:00
|
|
|
ADD . /go/src/github.com/cerc-io/ipld-eth-db
|
2022-05-10 10:45:57 +00:00
|
|
|
|
2023-03-13 13:38:00 +00:00
|
|
|
# Get migration tool
|
|
|
|
WORKDIR /
|
2022-07-22 06:14:07 +00:00
|
|
|
ARG GOOSE_VER="v3.6.1"
|
2023-10-18 13:16:16 +00:00
|
|
|
RUN arch=$(arch | sed s/aarch64/arm64/) && \
|
|
|
|
wget -O ./goose https://github.com/pressly/goose/releases/download/${GOOSE_VER}/goose_linux_${arch}
|
2023-03-13 13:38:00 +00:00
|
|
|
RUN chmod +x ./goose
|
2022-05-10 10:45:57 +00:00
|
|
|
|
|
|
|
# app container
|
|
|
|
FROM alpine
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-03-21 17:49:12 +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
|
|
|
|
2023-03-13 13:38:00 +00:00
|
|
|
COPY --from=builder /goose goose
|
|
|
|
COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-db/db/migrations migrations
|
2022-05-10 10:45:57 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/app/startup_script.sh"]
|