eth-tracker/Dockerfile
Mohamed Sohail 天明 efc84970cc
refactor: Decouple router and handlers (#31)
* refactor: decouple router to allow adding custom log and input data handlers

* feat: refactor handlers

* devops: update service build args

* chore: cleanup unecessary files/code
2024-09-18 17:35:57 +03:00

28 lines
631 B
Docker

FROM golang:1.23.0-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-tracker-cache-bootstrap -ldflags="-X main.build=${BUILD} -s -w" cmd/bootstrap/main.go
RUN go build -o celo-tracker -ldflags="-X main.build=${BUILD} -s -w" cmd/service/*.go
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/* .
EXPOSE 5001
CMD ["./celo-tracker"]