FROM python:3.12-slim

RUN groupadd -g 1000 harmonyrun \
    && useradd -m -u 1000 -g 1000 -s /bin/bash harmonyrun

# hdc (HarmonyOS Device Connector) is not packaged in Debian slim; mount/copy the host binary
# into PATH or bake it into a derived image. curl is kept for uv installer below.
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    curl \
    && rm -rf /var/lib/apt/lists/*

USER harmonyrun

WORKDIR /harmonyrun

RUN curl -LsSf https://astral.sh/uv/install.sh | sh

ENV PATH="/home/harmonyrun/.local/bin:${PATH}"

COPY . .

RUN uv venv && \
    uv pip --no-cache-dir install .[google,anthropic,openai,deepseek,ollama,openrouter]

ENTRYPOINT [".venv/bin/harmonyrun"]

CMD ["--help"]