us-dop-scrapper/Dockerfile
maximo tejeda a86d4fdf90
All checks were successful
${{ github.actor }} executed Build Push Prod / build (push) Successful in 5m14s
${{ github.actor }} executed Build Push Prod / deploy (push) Successful in 20s
fix
2024-12-03 11:10:07 -04:00

20 lines
566 B
Docker

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