us-dop-scrapper/Dockerfile
maximo tejeda 3f51cf48e8
Some checks failed
${{ github.actor }} executed Build Push Prod / build (push) Failing after 19s
${{ github.actor }} executed Build Push Prod / deploy (push) Has been skipped
install play wrigth
2024-12-03 10:01:20 -04:00

18 lines
581 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
RUN go run github.com/playwright-community/playwright-go/cmd/playwright@v0.4802.0 install --with-deps
# 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
COPY /app/bin/crawler /usr/bin/
ENTRYPOINT /usr/bin/crawler