feat: Docker engine + unified compose + root health route#2
Open
3L0935 wants to merge 2 commits into
Open
Conversation
Three changes to make Pythia self-hostable without fragile frontend patches:
1. **Dockerfile for the engine** — multi-stage Python 3.13 Alpine build
(~80MB final image). Uses uv for fast dependency resolution.
No Osiris overlay needed — the engine talks to Osiris via HTTP.
2. **docker-compose.yml** — unified stack: Osiris (GHCR prebuilt) +
Pythia engine (local build). Docker internal network so Pythia
reaches Osiris at http://osiris:3000. All config via env vars
with sensible defaults. Single 'docker compose up -d' to start.
3. **Root health route (GET /)** — FastAPI returns 404 on / by default,
which breaks load balancers, service monitors (Docker healthcheck,
Hermes Hub, k8s probes). Added a lightweight root route returning
{"status":"ok","service":"pythia-oracle"}.
Also added .dockerignore to keep the image lean.
Why: the current install requires manually patching 15+ files into an
Osiris checkout. This compose file gives you the full agent API
(/agent/view, /agent/events, /predictions, /chat, /state/stream)
with zero frontend patches — just docker compose up.
…condition, .dockerignore coverage Follow-up improvements to the Docker engine PR: Dockerfile: - Split pip install uv from uv sync for better layer caching - Add --no-cache-dir to pip install to keep builder lean - Add HEALTHCHECK using the root route (GET /) - Add PYTHONUNBUFFERED=1 and PYTHIA_ROOT env vars - Named runtime stage for clarity docker-compose.yml: - Add healthcheck on osiris service (wget /api/health) - depends_on now uses condition: service_healthy - Fix LLM_BASE_URL default: localhost is unreachable from a container; use host.docker.internal instead (with extra_hosts mapping) - Add extra_hosts to pythia service for host.docker.internal on Linux .dockerignore: - Add .github, .env.example, demo.mp4, .gitignore, .dockerignore, docker-compose.yml - Use *.md glob instead of enumerating README.md + CONTRIBUTING.md engine/server.py: - Root route now includes app.version for debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The current install flow requires manually patching 15+ files into an Osiris checkout (
integrations/osiris/INSTALL.md). This is fragile:run-all.shand a macOS.appwrapperGET /route, so load balancers and service monitors (Docker healthcheck, k8s probes, Hermes Hub) get 404Solution
Three additions, zero breaking changes:
1.
Dockerfilefor the engineMulti-stage Python 3.13 Alpine build (~80MB final image). Uses
uvfor fast dependency resolution. The engine talks to Osiris via HTTP — no frontend overlay needed.2.
docker-compose.ymlUnified stack: Osiris (GHCR prebuilt image) + Pythia engine (local build). Docker internal network so Pythia reaches Osiris at
http://osiris:3000. All config via environment variables with sensible defaults. Singledocker compose up -dto start the full agent API.3. Root health route (
GET /)FastAPI returns 404 on
/by default. Added a lightweight root route returning{"status":"ok","service":"pythia-oracle"}so Docker healthchecks, k8s probes, and service dashboards work out of the box.Also added
.dockerignoreto keep the image lean.How to test
What this does NOT change
run-all.sh/PYTHIA.app/ overlay install still workdocker-compose.ymluses the GHCR prebuilt Osiris image (falls back to local build if unavailable)Why this matters
This makes Pythia usable as a headless agent API — no globe UI needed. Agents (Hermes, Claude, custom) get the full world view via
GET /agent/viewwith zero frontend setup. The compose file is also a foundation for future improvements (adding Ollama as a compose service, healthcheck definitions, etc.).