docling-studio/docker-compose.yml
Pier-Jean Malandrino 7616dbc28d feat(#73): add OpenSearch and embedding service to production docker-compose
Production stack now includes OpenSearch single-node and embedding-service
alongside the existing document-parser and frontend. OPENSEARCH_URL and
EMBEDDING_URL wired into document-parser; persistent volume for OpenSearch data.
2026-04-10 21:46:44 +02:00

94 lines
2.5 KiB
YAML

# =============================================================================
# Docling Studio — Production stack
#
# Usage:
# docker compose up -d
#
# Includes OpenSearch single-node + embedding service for the ingestion pipeline.
# Set OPENSEARCH_URL and EMBEDDING_URL in .env to enable ingestion features.
# =============================================================================
services:
# --- OpenSearch (single-node, security disabled) ---
opensearch:
image: opensearchproject/opensearch:2
environment:
discovery.type: single-node
DISABLE_SECURITY_PLUGIN: "true"
OPENSEARCH_JAVA_OPTS: "-Xms512m -Xmx512m"
expose:
- "9200"
volumes:
- opensearch_data:/usr/share/opensearch/data
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 10
deploy:
resources:
limits:
memory: 2g
# --- Embedding service (sentence-transformers) ---
embedding:
build:
context: ./embedding-service
expose:
- "8001"
environment:
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-all-MiniLM-L6-v2}
EMBEDDING_BATCH_SIZE: ${EMBEDDING_BATCH_SIZE:-64}
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8001/health || exit 1"]
interval: 15s
timeout: 10s
retries: 20
start_period: 120s
deploy:
resources:
limits:
memory: 2g
# --- Backend (FastAPI) ---
document-parser:
build:
context: ./document-parser
target: ${CONVERSION_MODE:-local}
expose:
- "8000"
volumes:
- uploads_data:/app/uploads
- db_data:/app/data
environment:
CORS_ORIGINS: ${CORS_ORIGINS:-http://localhost:3000,http://localhost:5173}
DOCLING_SERVE_URL: ${DOCLING_SERVE_URL:-}
DOCLING_SERVE_API_KEY: ${DOCLING_SERVE_API_KEY:-}
RATE_LIMIT_RPM: ${RATE_LIMIT_RPM:-100}
MAX_FILE_SIZE_MB: ${MAX_FILE_SIZE_MB:-50}
BATCH_PAGE_SIZE: ${BATCH_PAGE_SIZE:-0}
OPENSEARCH_URL: http://opensearch:9200
EMBEDDING_URL: http://embedding:8001
depends_on:
opensearch:
condition: service_healthy
embedding:
condition: service_healthy
deploy:
resources:
limits:
memory: 4g
# --- Frontend (Nginx) ---
frontend:
build:
context: ./frontend
ports:
- "3000:80"
depends_on:
- document-parser
volumes:
opensearch_data:
uploads_data:
db_data: