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 FrontendBoth 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-infraThis 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-storeThis runs 6 processes from a single Docker image:
| Process | Role |
|---|---|
| API | FastAPI HTTP server |
| Read Worker | EventStoreDB → MongoDB projection |
| Pipeline Worker | Event-driven workflow triggers |
| Temporal Worker | CPU-bound activities (embeddings, OCSR) |
| LLM Worker | LLM-dependent activities (summarization, NER) |
| Plugin Consumer | Kafka-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 onAPI_PORT, default 8002)
Resource Recommendations
| Component | CPU | Memory |
|---|---|---|
| API | 1 core | 512 MB |
| Temporal Worker | 2 cores | 2 GB |
| LLM Worker | 1 core | 1 GB |
| MongoDB | 1 core | 1 GB |
| EventStoreDB | 1 core | 1 GB |
| Qdrant | 1 core | 2 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