scroll-tech / scroll

Scroll's Monorepo
MIT License
707 stars 603 forks source link

A corrected and slightly refined version #1516

Open olegmosso opened 2 months ago

olegmosso commented 2 months ago

Download Go dependencies

FROM golang:1.21-alpine3.19 AS base

WORKDIR /src COPY ./bridge-history-api/go.* ./ RUN go mod download -x

Build db_cli

FROM base AS builder

WORKDIR /src/bridge-history-api/cmd/db_cli RUN --mount=type=cache,target=/root/.cache/go-build \ go build -v -p 4 -o /bin/db_cli

Pull db_cli into a second stage deploy alpine container

FROM alpine:latest COPY --from=builder /bin/db_cli /bin/db_cli WORKDIR /app ENTRYPOINT ["/bin/db_cli"]