build: collector service Dockerfile#5
Conversation
Container image for agent_core.collector; runs 'python -m agent_core.collector', set HYRULE_COLLECTOR_DATABASE_URL to postgresql+asyncpg in prod. Built on the loop host by the (forthcoming) ansible collector role via docker build, mirroring knowledge-mcp. Runtime validated via the TestClient suite; image build validated on the target host (no docker daemon in this dev env). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 709131bcec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| RUN uv venv && uv pip install '.[collector]' | ||
|
|
||
| EXPOSE 8770 | ||
| USER 65534:65534 |
There was a problem hiding this comment.
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 👍 / 👎.
Adds the container image for the trace collector so the
loophost candocker builditlike knowledge-mcp.
Dockerfile— python:3.12-slim + uv, installsagent-core[collector], runspython -m agent_core.collector(FastAPI);HYRULE_COLLECTOR_DATABASE_URLselects the DB(postgresql+asyncpg in prod).
.dockerignore.Runtime validated by the collector TestClient suite (#4). No docker daemon in CI/dev here, so
the image build is validated on the target host by the ansible
collectorrole (C3).🤖 Generated with Claude Code