# Customer-owned example build. Supply the ecosystem package and executable you choose.
ARG PYTHON_IMAGE=python:3.12-slim
FROM ${PYTHON_IMAGE}
ARG PLUGIN_PACKAGE
ARG PLUGIN_EXECUTABLE
ARG CONNECTOR_KIND=source
ARG CONFIG_ADAPTER=adapters
RUN test -n "$PLUGIN_PACKAGE" && test -n "$PLUGIN_EXECUTABLE" \
    && pip install --no-cache-dir "$PLUGIN_PACKAGE" fastapi==0.136.3 uvicorn==0.52.3 boto3==1.42.14
ENV CONNECTOR_CONFIG_ADAPTER=$CONFIG_ADAPTER SINGER_EXECUTABLE=$PLUGIN_EXECUTABLE CONNECTOR_KIND=$CONNECTOR_KIND HOME=/tmp \
    PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
COPY gateway.py /opt/connector/gateway.py
COPY entrypoint.py /opt/connector/entrypoint.py
COPY adapters.py /opt/connector/adapters.py
USER 10001:10001
ENTRYPOINT ["python", "/opt/connector/entrypoint.py"]
