FROM gitea.pena/penadevops/container-images/golang:main as builder
WORKDIR /app
COPY . .
ENV GOPRIVATE=gitea.pena/PenaSide/linters-golang
ENV GOINSECURE=gitea.pena/PenaSide/linters-golang
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -gcflags "all=-N -l" -o heruvym cmd/main.go

FROM gitea.pena/penadevops/container-images/alpine:main
COPY --from=builder /app/heruvym .
COPY prod.key .
COPY prod.crt .
EXPOSE 1488
CMD ["/heruvym"]
