FROM registry.access.redhat.com/ubi9/python-312:latest

USER 0

WORKDIR /app

COPY server.py build_archive.py ./
COPY payload/ payload/

RUN pip install --no-cache-dir starlette uvicorn && \
    python build_archive.py && \
    chown -R 1001:0 /app

USER 1001

EXPOSE 8097

CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8097", "--log-level", "warning"]
