us-dop-scrapper/Dockerfile
maximo tejeda ad366d1af5
Some checks failed
${{ github.actor }} executed Build Push Prod / build (push) Successful in 3m29s
${{ github.actor }} executed Build Push Prod / deploy (push) Failing after 19s
add git
2024-12-02 22:11:16 -04:00

20 lines
512 B
Docker

FROM golang:alpine AS builder
ARG TARGETARCH
ARG version=not-set
ARG SHORTSHA=not-set
RUN apk add 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 alpine AS runner
COPY --from=builder /app/bin/crawler /usr/bin/
WORKDIR /app
ENTRYPOINT /usr/bin/crawler