2024-06-10 09:36:26 +02:00
|
|
|
FROM golang:1.22.3-bookworm as build
|
|
|
|
|
|
|
|
ENV CGO_ENABLED=1
|
|
|
|
|
|
|
|
ARG BUILDPLATFORM
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
ARG BUILD=dev
|
|
|
|
|
|
|
|
RUN echo "Building on $BUILDPLATFORM, building for $TARGETPLATFORM"
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
RUN go mod download
|
|
|
|
RUN go build -o celo-indexer -ldflags="-X main.build=${BUILD} -s -w" cmd/*
|
|
|
|
|
|
|
|
FROM debian:bookworm-slim
|
|
|
|
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
WORKDIR /service
|
|
|
|
|
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
COPY --from=build /build/* .
|
|
|
|
|
2024-06-10 09:45:43 +02:00
|
|
|
EXPOSE 5002
|
2024-06-10 09:36:26 +02:00
|
|
|
|
|
|
|
CMD ["./celo-indexer"]
|