eth-indexer/Dockerfile

31 lines
603 B
Docker
Raw Normal View History

FROM golang:1.23.3-bookworm as build
2024-06-10 09:36:26 +02:00
ENV CGO_ENABLED=1
ARG BUILDPLATFORM
ARG TARGETPLATFORM
ARG BUILD=dev
RUN echo "Building on $BUILDPLATFORM, building for $TARGETPLATFORM"
2024-10-08 12:03:04 +02:00
WORKDIR /build
2024-06-10 09:36:26 +02:00
COPY . .
RUN go mod download
2024-10-08 12:03:04 +02:00
RUN go build -o eth-indexer -ldflags="-X main.build=${BUILD} -s -w" cmd/service/*.go
2024-06-10 09:36:26 +02:00
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 10:18:24 +02:00
COPY migrations migrations/
COPY config.toml .
COPY queries.sql .
COPY LICENSE .
2024-06-10 09:36:26 +02:00
2024-06-10 09:45:43 +02:00
EXPOSE 5002
2024-06-10 09:36:26 +02:00
CMD ["./eth-indexer"]