# DocAI Fabric — Self-Hosted Standalone (Single Node) # Companion file for the guide: https://app.docaifabric.com/docs/deployment/self-hosted-standalone # Save this file as docker-compose.yml next to your .env settings file. services: redis: image: redis:7-alpine command: redis-server --appendonly yes --maxmemory 512mb --maxmemory-policy noeviction volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 5 restart: unless-stopped docaifabric: image: ${DOCAI_IMAGE} # The image is x86_64 (amd64) only. This line lets it run on Apple Silicon # Macs under emulation; on a native x86_64 host it is a harmless no-op. platform: linux/amd64 depends_on: redis: condition: service_healthy ports: - "8080:8080" volumes: - ./data/storage:/app/storage environment: # Connect to the Redis service defined below - REDIS_URL=redis://redis:6379/0 # Secrets (set these in .env) - ADMIN_API_KEY=${ADMIN_API_KEY} - TENANT_MODELS_ENCRYPTION_KEY=${TENANT_MODELS_ENCRYPTION_KEY} # Public URL used in links the app shows - APP_URL=${APP_URL:-http://localhost:8080} # OCR engines. The two bundled engines run locally, no cloud. Microsoft # Read is optional and calls Azure Document Intelligence (needs the # endpoint + key below and outbound HTTPS). Values come from .env (Step 4). - RAPID_OCR_ENABLED=${RAPID_OCR_ENABLED:-true} - TESSERACT_OCR_ENABLED=${TESSERACT_OCR_ENABLED:-true} - MICROSOFT_OCR_ENABLED=${MICROSOFT_OCR_ENABLED:-false} - MICROSOFT_OCR_ENDPOINT=${MICROSOFT_OCR_ENDPOINT:-} - MICROSOFT_OCR_KEY=${MICROSOFT_OCR_KEY:-} - DEFAULT_OCR_ENGINE=${DEFAULT_OCR_ENGINE:-rapid_ocr} # Default LLM — any OpenAI-compatible endpoint. Values come from .env (Step 4). - LLM_BASE_URL=${LLM_BASE_URL:-} - LLM_MODEL=${LLM_MODEL:-} - LLM_API_KEY=${LLM_API_KEY:-} - LLM_PROTOCOL=${LLM_PROTOCOL:-openai_compatible} - LLM_AUTH_MODE=${LLM_AUTH_MODE:-bearer} # Advanced: several LLM endpoints (failover / load-balance) as a JSON array. - AZURE_OPENAI_ENDPOINTS=${AZURE_OPENAI_ENDPOINTS:-} # AI Assistant. By default it uses the Default LLM above and turns on # automatically once a Default LLM is set. Set ASSISTANT_ENABLED=false to # turn it off, or ASSISTANT_MODEL to give it a different model (Step 4). - ASSISTANT_ENABLED=${ASSISTANT_ENABLED:-true} - ASSISTANT_MODEL=${ASSISTANT_MODEL:-} # Email notifications (optional). Set the SMTP_* values in .env to enable # invitation and notification emails; email stays off while SMTP_HOST is empty. - SMTP_HOST=${SMTP_HOST:-} - SMTP_PORT=${SMTP_PORT:-587} - SMTP_USER=${SMTP_USER:-} - SMTP_PASSWORD=${SMTP_PASSWORD:-} - SMTP_FROM=${SMTP_FROM:-} - SMTP_USE_TLS=${SMTP_USE_TLS:-true} # Apple Silicon Macs only (see .env). Harmless to leave as-is elsewhere. - RULE_EXECUTOR_USE_VM=${RULE_EXECUTOR_USE_VM:-false} restart: unless-stopped healthcheck: test: ["CMD-SHELL", "python -c 'import requests; requests.get(\"http://localhost:8080/health\", timeout=5)'"] interval: 30s timeout: 10s retries: 3 start_period: 40s volumes: redis_data: