FROM python:3.12-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    PYTHONPATH=/app

WORKDIR /app

RUN apt-get update \
    && apt-get install -y --no-install-recommends curl \
    && rm -rf /var/lib/apt/lists/*

COPY libs/agent_framework /opt/agent_framework
COPY templates/agent_template_backend/requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip \
    && pip install -e /opt/agent_framework \
    && pip install -r /tmp/requirements.txt

COPY templates/agent_template_backend /app

EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
