simplify dockerfile
All checks were successful
Docker Build / Dummy job (pull_request) Successful in 3s
Docker Build / Run docker build (pull_request) Successful in 22s

This commit is contained in:
Roy Crihfield 2024-05-28 23:28:59 +08:00
parent 68a347e38d
commit 99ddbcd4e4

View File

@ -1,12 +1,10 @@
FROM golang:1.18-alpine as builder FROM alpine as builder
ADD . /go/src/github.com/cerc-io/ipld-eth-db
# Get migration tool # Get migration tool
WORKDIR / WORKDIR /
ARG GOOSE_VER="v3.6.1" ARG GOOSE_VERSION="v3.6.1"
RUN arch=$(arch | sed s/aarch64/arm64/) && \ 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 RUN chmod +x ./goose
# app container # app container
@ -14,9 +12,8 @@ FROM alpine
WORKDIR /app 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 /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"] ENTRYPOINT ["/app/startup_script.sh"]