us-dop-api/Dockerfile
maximo tejeda e9a9fb1ddc
Some checks failed
dev test / test (push) Successful in 6s
dev test / vulnCheck (push) Successful in 27s
dev test / Ci-Lint (push) Failing after 9s
${{ github.actor }} executed Build Push Prod / build (push) Failing after 37s
${{ github.actor }} executed Build Push Prod / deploy (push) Has been skipped
fix DOCKERFILE
2024-12-03 22:17:42 -04:00

19 lines
517 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-api \
-ldflags "-X main.Shortsha=${SHORTSHA} \
-X main.Version=${version} \
-X main.Aarch=${TARGETARCH}" ./cmd
FROM alpine AS runner
WORKDIR /app
COPY --from=builder /app/bin/us-dop-api /usr/bin/
COPY --from=builder /app/assets/ /app/assets/
ENTRYPOINT /usr/bin/us-dop-api