FROM golang:alpine AS builder
LABEL maintainer="IRT PFN"
ENV DOCKER_ENVIRONMENT=true
WORKDIR /app

COPY . .

RUN go build .

FROM oc-monitord:latest AS monitord

FROM argoproj/argocd:latest

ENV MONITORD_PATH = "./oc-monitord"

WORKDIR /app

COPY conf/docker_schedulerd.json /etc/oc/schedulerd.json

COPY --from=monitord /app/oc-monitord .
COPY --from=builder /app/oc-schedulerd .
COPY conf/docker_schedulerd.json /etc/oc/schedulerd.json

ENTRYPOINT ["/app/oc-schedulerd"]

