ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim-bookworm

# Install system dependencies
RUN apt-get update && apt-get install -y \
  git \
  curl \
  jq \
  && rm -rf /var/lib/apt/lists/*

# Create agent user with UID 1000 for compatibility with --userns=keep-id and --user 1000:1000
RUN useradd -m -u 1000 -s /bin/bash agent
USER agent

# Trust any bind-mounted directory regardless of host ownership
RUN git config --global --add safe.directory '*'

# Install Claude Code CLI
RUN curl -fsSL https://claude.ai/install.sh | bash

# Add Claude to PATH
ENV PATH="/home/agent/.local/bin:$PATH"

WORKDIR /home/agent

ENTRYPOINT ["sleep", "infinity"]
