Skip to content

Docker

eodia insights is built as a single image from the repository’s Dockerfile; it is published on Docker Hub as eodia/insights. It contains the server — a Rust binary, eodia-server, that serves the API, Trino’s OPA endpoint, MCP and the job queue — and the interface; the argument given to the container chooses what it runs. docker-compose.prod.yml puts this image together with PostgreSQL, Trino and Caddy. All configuration goes through environment variables.

Fenêtre de terminal
docker build -t eodia-insights .

It is based on Node 22 (for the interface) and Debian Bookworm, runs as the node user, and starts its processes under tini. The server is compiled separately, in Rust, and copied into /usr/local/bin (eodia-server, and eodia-mcp, standalone MCP over HTTP or stdio); the interface is compiled by next build as standalone output. The image is built for linux/amd64 and linux/arm64.

RoleCommandPortWhat it does
serverdocker run eodia-insights server4100REST /api/v1, authentication, public pages, internal OPA endpoint, MCP on /mcp; the job queue with INPROCESS_WORKER=1
webdocker run eodia-insights web3100the Next.js interface
workerdocker run eodia-insights worker—the job queue alone: synchronizations, dashboard pre-warming, subscriptions
mcpdocker run eodia-insights mcp4200optional: MCP alone (eodia-mcp, port MCP_PORT), relaying to the API at API_URL; the server already serves /mcp
all (default)docker run eodia-insights3100, 4100server (with its job queue) and web in a single container

The api role of earlier versions is still accepted, as a synonym of server.

In all mode, a small supervisor starts the two processes, prefixes their logs ([server], [web]), forwards shutdown, and stops the whole container as soon as one of them dies: the orchestrator then restarts it in full rather than leaving a half-alive instance running. It runs the job queue inside the server (INPROCESS_WORKER=1, unless told otherwise). The interface relays /api/* and /mcp to the server: the address shown in « API and MCP » answers without a proxy in front.

docker-compose.prod.yml runs one service per role:

ServiceImageRole
catalogpostgres:17-alpinethe application catalog (catalog-data volume)
trinotrinodb/trino:483the engine; its authorizations are requested from the server
servereodia-insightsthe API, the OPA endpoint, MCP and the job queue (INPROCESS_WORKER=1); applies migrations on startup
webeodia-insightsthe interface
rendergotenberg/gotenberg:8.20.1optional (render profile): subscriptions as PDF or image
caddycaddy:2-alpineautomatic HTTPS, ports 80 and 443 (caddy-data, caddy-config volumes)

Startup order matters: the server waits for the catalog, but not for Trino — it must be listening before Trino queries it. The interface waits for the server to answer its health check (/api/health, port 4100).

Fenêtre de terminal
docker compose -f docker-compose.prod.yml up -d --build # build and start
docker compose -f docker-compose.prod.yml logs -f server # follow the server
docker compose -f docker-compose.prod.yml ps # status and health of the services
docker compose -f docker-compose.prod.yml down # stop (volumes are kept)

IMAGE chooses the image used (default eodia-insights:latest); for the published image, IMAGE=eodia/insights:0.8.0 for instance. In production, pin an exact version rather than latest.

Trino reads three files from docker/trino/etc, mounted read-only:

FileContents
config.propertiesa coordinator that is also a worker; dynamic catalogs (catalog.management=dynamic) kept in memory (catalog.store=memory); 1 GB of memory per query
access-control.propertiesthe opa access control, pointed at the server (${ENV:OPA_URL}): /allow, /batch, /row-filters, /column-masks
jvm.configthe JVM options, including a 2 GB heap (-Xmx2G)

Trino keeps nothing on disk: the application is the source of truth. It recreates the catalogs of all sources on startup, during the job queue’s periodic tasks (at most once a minute) if any are missing, and as soon as a query finds a catalog absent. A Trino restart therefore repairs itself.

The OPA endpoint address comes from OPA_URL, which the compose file builds: http://server:4100/internal/opa/${OPA_SECRET}. The host name is that of the service running the server: in a stack in all mode (a single insights service, say), it is http://insights:4100/internal/opa/${OPA_SECRET}. After a change, recreate Trino (docker compose up -d trino): it reads its environment only on startup.

docker/Caddyfile serves DOMAIN over HTTPS (Let’s Encrypt; ACME_EMAIL as the contact), compresses responses, sets HSTS and a few security headers, then routes:

PathTo
/api/*server:4100, unbuffered (the copilot and synchronization progress use SSE)
/mcp*server:4100, unbuffered
/internal/*404 response: the OPA endpoint is never exposed
everything elseweb:3100

Jobs live in the PostgreSQL catalog. Several processes can run them together — the server with INPROCESS_WORKER=1, and as many worker containers as you like: each one claims its own with FOR UPDATE SKIP LOCKED, and a job whose worker has stopped is picked up by another. The migrations are applied by the first process to start, server or worker, under a lock.

Two things are enough to rebuild an instance:

  • the catalog database (catalog), for example with pg_dump;
  • the SECRET_KEY key: without it, the source passwords and embedding secrets in the backup cannot be read.

Trino has nothing to back up.

eodia insights is free software by Eodia.