DocuStore.io

Production Deployment

Deploy DocuStore to production with Docker Swarm.

For production workloads, DocuStore uses Docker Swarm with two compose stacks: infrastructure and application.

Stack Architecture

docker-compose.infra.yml  →  MongoDB, EventStoreDB, Kafka, Temporal, Qdrant, Langfuse, Umami
docker-compose.prod.yml   →  API, Workers, Web Frontend

Both files live at the repository root. The stacks share the docu-store overlay network for inter-service communication.

Infrastructure Stack

Deploy infrastructure services first:

docker stack deploy -c docker-compose.infra.yml docu-store-infra

This provisions:

  • EventStoreDB with persistent storage
  • MongoDB as a single-node replica set (rs0), with authentication disabled
  • Qdrant with snapshot persistence
  • Temporal server + PostgreSQL backend
  • Kafka as a single-node KRaft broker (no Zookeeper)
  • Langfuse and Umami for observability

MongoDB and EventStoreDB run without authentication (EventStoreDB in insecure mode). Keep them on the private overlay network (the infra file publishes EventStoreDB on host port 2114; firewall it or drop the mapping), and enable authentication if they must be reachable from elsewhere.

Application Stack

Once infrastructure is healthy, fill in secrets and deploy the application:

cp .env.prod.example .env.prod
docker stack deploy -c docker-compose.prod.yml docu-store

This runs 6 processes from a single Docker image:

ProcessRole
APIFastAPI HTTP server
Read WorkerEventStoreDB → MongoDB projection
Pipeline WorkerEvent-driven workflow triggers
Temporal WorkerCPU-bound activities (embeddings, OCSR)
LLM WorkerLLM-dependent activities (summarization, NER)
Plugin ConsumerKafka-to-Temporal bridge

Reverse Proxy

The application stack is designed to sit behind a reverse proxy (Traefik, Nginx, etc.) for TLS termination and routing:

  • docu-store.example.com → Web frontend (port 15000)
  • docu-store-api.example.com → API server (container port 8000, published on API_PORT, default 8002)

Resource Recommendations

ComponentCPUMemory
API1 core512 MB
Temporal Worker2 cores2 GB
LLM Worker1 core1 GB
MongoDB1 core1 GB
EventStoreDB1 core1 GB
Qdrant1 core2 GB

Total minimum: 8 cores, 8 GB RAM (excluding LLM inference if using Ollama locally).

Monitoring

  • Langfuse for LLM tracing and prompt observability
  • Umami for web analytics
  • Temporal Dashboard for workflow monitoring