FROM golang:latest AS builder ARG TARGETARCH ARG version=not-set ARG SHORTSHA=not-set RUN apt update && apt install git WORKDIR /app COPY . . RUN go mod tidy # https://stackoverflow.com/questions/70369368/check-architecture-in-dockerfile-to-get-amd-arm RUN go build -o bin/crawler \ -ldflags "-X main.Shortsha=${SHORTSHA} \ -X main.Version=${version} \ -X main.Aarch=${TARGETARCH}" ./cmd/crawler/main.go FROM mcr.microsoft.com/playwright:v1.48.2-noble #FROM alpine AS runner COPY --from=builder /app/bin/crawler /usr/bin/ ENTRYPOINT /usr/bin/crawler