us-dop-bot/Dockerfile
maximo tejeda 6f907ca9ec
Some checks failed
${{ github.actor }} executed Build Push Prod / build (push) Failing after 47s
${{ github.actor }} executed Build Push Prod / deploy (push) Has been skipped
FIX entry build go
2024-12-04 22:29:56 -04:00

20 lines
577 B
Docker

FROM golang:alpine AS builder
ARG TARGETARCH
ARG version=not-set
ARG SHORTSHA=not-set
WORKDIR /app
COPY . .
# https://stackoverflow.com/questions/70369368/check-architecture-in-dockerfile-to-get-amd-arm
RUN go build -o bin/us-dop-bot \
-ldflags "-X main.Shortsha=${SHORTSHA} \
-X main.Version=${version} \
-X main.Aarch=${TARGETARCH}" ./cmd/bot/main.go
FROM alpine AS runner
COPY --from=builder /app/bin/us-dop-bot /usr/bin/
WORKDIR /app
RUN apk --no-cache add --no-check-certificate ca-certificates \
&& update-ca-certificates
ENTRYPOINT /usr/bin/us-dop-bot