FROM gitea.pena/penadevops/container-images/golang:1.23.8-alpine as build
WORKDIR /app
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o wrkr ./cmd/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o validator ./cmd/validator/main.go

FROM gitea.pena/penadevops/container-images/alpine:main as prod
COPY --from=build /app/validator .
COPY --from=build /app/wrkr .
CMD ["/wrkr"]
