Archon/python/Dockerfile.agents
Cole Medin 9f22659f4c
Moving Dockerfiles to uv for package installation (#533)
* Moving Dockerfiles to uv for package installation

* Updating uv installation for CI
2025-08-30 11:33:11 -05:00

34 lines
991 B
Docker

# Agents Service - Lightweight Pydantic AI agents
FROM python:3.12-slim
WORKDIR /app
# Install uv
RUN pip install --no-cache-dir uv
# Copy pyproject.toml for dependency installation
COPY pyproject.toml .
# Install only agents dependencies using uv
RUN uv pip install --system --group agents
# Copy agents code - no dependencies on server code
# Agents use MCP tools for all operations
COPY src/agents/ src/agents/
COPY src/__init__.py src/
# Set environment variables
ENV PYTHONPATH="/app:$PYTHONPATH"
ENV PYTHONUNBUFFERED=1
# Expose Agents port
ARG ARCHON_AGENTS_PORT=8052
ENV ARCHON_AGENTS_PORT=${ARCHON_AGENTS_PORT}
EXPOSE ${ARCHON_AGENTS_PORT}
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD sh -c "python -c \"import urllib.request; urllib.request.urlopen('http://localhost:${ARCHON_AGENTS_PORT}/health')\""
# Run the Agents service
CMD sh -c "python -m uvicorn src.agents.server:app --host 0.0.0.0 --port ${ARCHON_AGENTS_PORT}"