docs: document dev/prod compose modes and make targets

README, docs/docker.md, and AGENTS.md now cover make compose-up (dev-forward,
builds from source) vs make compose-up-prod (pulls ghcr latest) and compose-down.
This commit is contained in:
Offending Commit
2026-06-02 13:51:23 -05:00
parent c9bd2db07d
commit e1285c73ad
3 changed files with 52 additions and 21 deletions

View File

@@ -17,6 +17,9 @@ Frontend UI for self-hosted Honcho instances — browse memories, peers, session
| `make test` | Vitest (unit + integration), excludes `e2e/` | | `make test` | Vitest (unit + integration), excludes `e2e/` |
| `make test-e2e` | Playwright e2e (uncached) | | `make test-e2e` | Playwright e2e (uncached) |
| `make smoke-docker` | Local: build image + hermetic smoke test of the `/api` proxy (Docker required) | | `make smoke-docker` | Local: build image + hermetic smoke test of the `/api` proxy (Docker required) |
| `make compose-up` | Run the web container from source (dev-forward, builds) at :8080 |
| `make compose-up-prod` | Run the web container from the published image (pulls `ghcr…:latest`) |
| `make compose-down` | Stop + remove the web container |
| `make check` | lint + typecheck + test | | `make check` | lint + typecheck + test |
| `pnpm --filter @openconcho/desktop cargo-check` | Local Rust/Tauri compile check before pushing desktop changes | | `pnpm --filter @openconcho/desktop cargo-check` | Local Rust/Tauri compile check before pushing desktop changes |
| `pnpm --filter @openconcho/web generate:api` | Regen `src/api/schema.d.ts` from `openapi.json` | | `pnpm --filter @openconcho/web generate:api` | Regen `src/api/schema.d.ts` from `openapi.json` |

View File

@@ -89,23 +89,29 @@ pnpm --filter @openconcho/desktop dev
### Docker (web app) ### Docker (web app)
Run the web UI in a container — handy for adding it to a self-hosted Honcho The container serves the SPA and reverse-proxies the Honcho API under its own
Compose stack. The image serves the SPA and reverse-proxies the Honcho API under origin: the browser calls `/api` same-origin and names the upstream in an
its own origin: the browser calls `/api` same-origin and names the upstream in an
`X-Honcho-Upstream` header, so there's no browser CORS to configure. `X-Honcho-Upstream` header, so there's no browser CORS to configure.
Two Compose modes (the published image is `ghcr.io/offendingcommit/openconcho-web`):
```bash ```bash
docker run --rm -p 8080:8080 \ # Dev-forward — build from this repo and run your local changes:
-e OPENCONCHO_DEFAULT_HONCHO_URL=http://host.docker.internal:8000 \ OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up
ghcr.io/offendingcommit/openconcho-web:latest
# Production — pull the latest published image instead of building:
OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up-prod
make compose-down # stop + remove
# → http://localhost:8080 # → http://localhost:8080
``` ```
`OPENCONCHO_DEFAULT_HONCHO_URL` seeds the first instance (absolute URL). `make compose-up` uses [`docker-compose.yml`](docker-compose.yml) (`build: .`);
`OPENCONCHO_UPSTREAM_ALLOWLIST` is an optional SSRF guard (comma-separated host `make compose-up-prod` layers [`docker-compose.prod.yml`](docker-compose.prod.yml)
globs) for when you expose the proxy. To drop it into a Honcho Compose stack, use to pull `ghcr…:latest`. `OPENCONCHO_DEFAULT_HONCHO_URL` seeds the first instance
the `openconcho` service in [`docker-compose.yml`](docker-compose.yml). Full (absolute URL); `OPENCONCHO_UPSTREAM_ALLOWLIST` is an optional SSRF guard
details and env vars are in [`docs/docker.md`](docs/docker.md). (comma-separated host globs) for when you expose the proxy. Full details and env
vars are in [`docs/docker.md`](docs/docker.md).
### Connecting to your instance ### Connecting to your instance

View File

@@ -15,18 +15,41 @@ applies**; the nginx→Honcho hop is server-side, where CORS is irrelevant. The
frontend stays the source of truth for which instance to talk to, so the frontend stays the source of truth for which instance to talk to, so the
multi-instance switcher and the Fleet view keep working. multi-instance switcher and the Fleet view keep working.
## Add it to a Honcho Compose stack (recommended) ## Compose: dev-forward vs prod
Honcho's self-hosting path is Docker Compose. Drop the `openconcho` service from Two Compose files, env/ports defined once in the base:
[`docker-compose.yml`](../docker-compose.yml) into the project that runs your
Honcho `api`: - **`docker-compose.yml`** — dev-forward: `build: .`, so it runs **your local source**.
- **`docker-compose.prod.yml`** — override that swaps the build for the **published
image** (`ghcr.io/offendingcommit/openconcho-web:latest`, `pull_policy: always`).
```bash
make compose-up # build from source + run → http://localhost:8080
make compose-up-prod # pull ghcr…:latest instead of building
make compose-down # stop + remove
```
`make compose-up-prod` expands to
`docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d`. Set env
inline or via a `.env` file:
```bash
OPENCONCHO_DEFAULT_HONCHO_URL=https://honcho.example.net make compose-up-prod
```
The published image is multi-arch (amd64 + arm64); the first publish creates a
private GHCR package — make it public for unauthenticated pulls.
## Add it to an existing Honcho Compose stack
Drop the `openconcho` service into the project that runs your Honcho `api`,
pointing the seed at the api service (nginx resolves it on the compose network):
```yaml ```yaml
services: services:
openconcho: openconcho:
image: ghcr.io/offendingcommit/openconcho-web:latest image: ghcr.io/offendingcommit/openconcho-web:latest
environment: environment:
# Seeds the first instance; nginx resolves this on the compose network.
OPENCONCHO_DEFAULT_HONCHO_URL: http://api:8000 OPENCONCHO_DEFAULT_HONCHO_URL: http://api:8000
ports: ports:
- "127.0.0.1:8080:8080" - "127.0.0.1:8080:8080"
@@ -39,14 +62,13 @@ services:
`OPENCONCHO_DEFAULT_HONCHO_URL` seeds the UI's first instance with an absolute `OPENCONCHO_DEFAULT_HONCHO_URL` seeds the UI's first instance with an absolute
URL. The browser sends that URL in the `X-Honcho-Upstream` header; nginx (on the URL. The browser sends that URL in the `X-Honcho-Upstream` header; nginx (on the
compose network) forwards to it — **no browser CORS, and the API token never compose network) forwards to it — **no browser CORS, and the API token never
leaves the origin.** The published image is multi-arch (amd64 + arm64); the first leaves the origin.**
publish creates a private GHCR package — make it public for unauthenticated pulls.
## Standalone ## Standalone (no compose)
```bash ```bash
docker build -t openconcho-web . docker run --rm -p 8080:8080 -e OPENCONCHO_DEFAULT_HONCHO_URL=http://host.docker.internal:8000 \
docker run --rm -p 8080:8080 -e OPENCONCHO_DEFAULT_HONCHO_URL=http://host.docker.internal:8000 openconcho-web ghcr.io/offendingcommit/openconcho-web:latest
# → http://localhost:8080 · GET /healthz returns "ok" # → http://localhost:8080 · GET /healthz returns "ok"
``` ```