From 99ddbcd4e45b2f8bbc89d24bcc5e436dc94cc85c Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Tue, 28 May 2024 23:28:59 +0800 Subject: [PATCH] simplify dockerfile --- Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d94a15d..b3b7193 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -FROM golang:1.18-alpine as builder - -ADD . /go/src/github.com/cerc-io/ipld-eth-db +FROM alpine as builder # Get migration tool WORKDIR / -ARG GOOSE_VER="v3.6.1" +ARG GOOSE_VERSION="v3.6.1" RUN arch=$(arch | sed s/aarch64/arm64/) && \ - wget -O ./goose https://github.com/pressly/goose/releases/download/${GOOSE_VER}/goose_linux_${arch} + wget -O ./goose https://github.com/pressly/goose/releases/download/${GOOSE_VERSION}/goose_linux_${arch} RUN chmod +x ./goose # app container @@ -14,9 +12,8 @@ FROM alpine WORKDIR /app -COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-db/scripts/startup_script.sh . - COPY --from=builder /goose goose -COPY --from=builder /go/src/github.com/cerc-io/ipld-eth-db/db/migrations migrations +ADD scripts/startup_script.sh . +ADD db/migrations migrations ENTRYPOINT ["/app/startup_script.sh"] -- 2.45.2