ARG ARTIFACTS_TOKEN=""
ARG NUCLIO_LABEL=1.12.5
ARG NUCLIO_ARCH=amd64
ARG NUCLIO_BASE_IMAGE=python:3.9
ARG NUCLIO_ONBUILD_IMAGE=quay.io/nuclio/handler-builder-python-onbuild:${NUCLIO_LABEL}-${NUCLIO_ARCH}

# Supplies processor uhttpc, used for healthcheck
FROM nuclio/uhttpc:0.0.1-amd64 as uhttpc

# Supplies processor binary, wrapper
FROM ${NUCLIO_ONBUILD_IMAGE} as processor

# From the base image
FROM ${NUCLIO_BASE_IMAGE}

# Copy required objects from the suppliers
COPY --from=processor /home/nuclio/bin/processor /usr/local/bin/processor
COPY --from=processor /home/nuclio/bin/py /opt/nuclio/
COPY --from=uhttpc /home/nuclio/bin/uhttpc /usr/local/bin/uhttpc

RUN apt-get update && apt-get install -y libgl1-mesa-dev libglib2.0-0

RUN pip install --upgrade pip
RUN pip install msgpack nuclio_sdk pydantic pydantic-settings requests opencv-python neo4j Pillow gspan-mining networkx pandas matplotlib numpy scikit-learn
RUN pip install --upgrade natural-agi-common==0.1.38
# Readiness probe
HEALTHCHECK --interval=1s --timeout=3s CMD /usr/local/bin/uhttpc --url http://127.0.0.1:8082/ready || exit 1

# USER CONTENT
COPY . /opt/nuclio/concept_creator
# END OF USER CONTENT

# Run processor with configuration and platform configuration
CMD [ "processor" ]
