FROM python:3.12-slim

WORKDIR /app

COPY requirements.txt .
RUN apt-get update && apt-get install -y --no-install-recommends \
    docker.io \
    podman \
    && rm -rf /var/lib/apt/lists/* \
    && pip install --no-cache-dir -r requirements.txt

COPY app/ ./app/
COPY config/ ./config/

EXPOSE 8100

# When running standalone, override these to point at your Prometheus/Alertmanager
ENV MARVIS_PROMETHEUS_URL=http://127.0.0.1:9090
ENV MARVIS_PROMETHEUS_PREFIX=/prometheus
ENV MARVIS_ALERTMANAGER_URL=http://127.0.0.1:9093
ENV MARVIS_AI_MODE=rule
ENV MARVIS_CONTAINER_RUNTIME=docker
ENV MARVIS_UERANSIM_ENV_FILE=/app/config/ueransim.env
# MARVIS_AI_MODE=openai  →  set MARVIS_OPENAI_API_KEY
# MARVIS_AI_MODE=ollama  →  set MARVIS_OLLAMA_URL + MARVIS_OLLAMA_MODEL

CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8100"]
