FROM golang:alpine AS builder

WORKDIR /app

COPY . .
RUN go mod download

COPY . .

RUN CGO_ENABLED=0 go build -o test-app .

FROM alpine:latest

RUN apk --no-cache add ca-certificates

WORKDIR /app/
COPY --from=builder /app/test-app .

ENTRYPOINT ["./test-app"]
