Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.git/
.venv/
__pycache__/
*.py[cod]
.mypy_cache/
.ruff_cache/
.pytest_cache/
tests/
dist/
build/
*.egg-info/
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Builds the agent-core trace collector service image.
# Built on the host by ansible/roles/collector (docker build), mirroring knowledge-mcp.
# Run: python -m agent_core.collector (FastAPI). Set HYRULE_COLLECTOR_DATABASE_URL to a
# postgresql+asyncpg URL in production.
FROM python:3.12-slim AS runtime

ENV PYTHONUNBUFFERED=1 \
UV_NO_CACHE=1 \
PATH="/app/.venv/bin:${PATH}" \
HYRULE_COLLECTOR_BIND=0.0.0.0 \
HYRULE_COLLECTOR_PORT=8770

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

COPY --from=ghcr.io/astral-sh/uv:0.9.17 /uv /uvx /usr/local/bin/

WORKDIR /app
COPY pyproject.toml README.md ./
COPY agent_core ./agent_core
RUN uv venv && uv pip install '.[collector]'

EXPOSE 8770
USER 65534:65534
Comment on lines +22 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Configure a usable default database

When this image is launched without HYRULE_COLLECTOR_DATABASE_URL (the Dockerfile does not set one), agent_core.collector.db falls back to sqlite+aiosqlite:///./collector.db. That default is not usable in this image: the install here only pulls agent-core[collector], which omits aiosqlite, and after switching to UID 65534 the process also cannot create collector.db under the root-owned /app. A plain docker run therefore exits before /healthz is served unless every caller supplies a Postgres URL; either make the sqlite fallback work in the image or fail/configure explicitly around the required database URL.

Useful? React with πŸ‘Β / πŸ‘Ž.

ENTRYPOINT ["python", "-m", "agent_core.collector"]
Loading