devops/deployment.md
Deployment
npm (recommended for most users)
Requires Bun:
npx @infinicon/server
Set PORT, DATABASE_URL, and INFINICON_API_KEY as needed. See packages/server/README.md.
Docker
docker build -t infinicon-server .
docker run -p 8787:8787 -e DATABASE_URL="postgres://..." infinicon-server
Reference server from source (Bun)
bun install
bun run dev
The server binds to 0.0.0.0:$PORT (default 8787).
Environment variables
| Variable | Required | Description |
|---|---|---|
PORT | no | HTTP port (default 8787) |
HOST | no | Bind address (default 0.0.0.0) |
DATABASE_URL | no | Postgres connection string; omit for in-memory dev storage |
INFINICON_API_KEY | no | When set, all /v0/* routes require Authorization: Bearer <key> |
JOB_POLL_MS | no | Background job runner interval (default 2000) |
Storage modes
- In-memory (default): single-process, ephemeral — fine for local dev and CI.
- Postgres (
DATABASE_URLset): durable JSONB-backed adapters with lexical index table. Render Postgres or any managed Postgres works.
Ephemeral filesystem on Render means local disk is not durable. Use Postgres for production persistence.
Health and metrics
GET /health— service status, plugin stats, storage mode, countersGET /metrics— JSON runtime counters (ingest/query/tombstone/jobs)
Render
See render.yaml at repo root. Web service + optional managed Postgres.
Build: bun install
Start: bun run src/server.ts
Verification before deploy
bun run verify