us-dop-scrapper/Dockerfile
maximo tejeda 1fc278c816
Some checks failed
${{ github.actor }} executed Build Push Prod / build (push) Failing after 16s
${{ github.actor }} executed Build Push Prod / deploy (push) Has been skipped
pg fix
2024-12-03 10:46:16 -04:00

21 lines
600 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/playwrightv1.48.2-noble
#FROM alpine AS runner
RUN playwright install --with-deps
COPY --from=builder /app/bin/crawler /usr/bin/
ENTRYPOINT /usr/bin/crawler