ci: add docker images, update docs

This commit is contained in:
2024-05-27 17:41:55 +08:00
parent a599bb200e
commit b35016dac1
7 changed files with 160 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
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-tracker -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/* .
EXPOSE 5001
CMD ["./celo-tracker"]