diff --git a/.env.example b/.env.example index ae64ea6..d6b13a2 100644 --- a/.env.example +++ b/.env.example @@ -143,6 +143,7 @@ USER_DOMAIN_NAME= LETSENCRYPT_EMAIL= COMFYUI_HOSTNAME=comfyui.yourdomain.com DIFY_HOSTNAME=dify.yourdomain.com +DOCLING_HOSTNAME=docling.yourdomain.com FLOWISE_HOSTNAME=flowise.yourdomain.com GRAFANA_HOSTNAME=grafana.yourdomain.com LANGFUSE_HOSTNAME=langfuse.yourdomain.com @@ -161,9 +162,9 @@ RAGAPP_HOSTNAME=ragapp.yourdomain.com RAGFLOW_HOSTNAME=ragflow.yourdomain.com SEARXNG_HOSTNAME=searxng.yourdomain.com SUPABASE_HOSTNAME=supabase.yourdomain.com +WAHA_HOSTNAME=waha.yourdomain.com WEAVIATE_HOSTNAME=weaviate.yourdomain.com WEBUI_HOSTNAME=webui.yourdomain.com -WAHA_HOSTNAME=waha.yourdomain.com # Everything below this point is optional. # Default values will suffice unless you need more features/customization. @@ -199,6 +200,15 @@ PADDLEOCR_USERNAME= PADDLEOCR_PASSWORD= PADDLEOCR_PASSWORD_HASH= +############ +# [required] +# Docling credentials (for Caddy basic auth) +############ + +DOCLING_USERNAME= +DOCLING_PASSWORD= +DOCLING_PASSWORD_HASH= + ############ # [required] # RAGApp credentials - used for Basic Auth in Caddy @@ -487,3 +497,16 @@ RAGFLOW_MYSQL_ROOT_PASSWORD= RAGFLOW_MINIO_ROOT_PASSWORD= RAGFLOW_REDIS_PASSWORD= RAGFLOW_ELASTICSEARCH_PASSWORD= + +############ +# [optional] +# Docling configuration +# DOCLING_IMAGE: Choose CPU or GPU version +# - ghcr.io/docling-project/docling-serve:cpu (4.4 GB, default) +# - ghcr.io/docling-project/docling-serve:cu126 (10.0 GB, NVIDIA GPU with CUDA 12.6) +# - ghcr.io/docling-project/docling-serve:cu128 (11.4 GB, NVIDIA GPU with CUDA 12.8) +# Note: Web UI is always enabled on /ui +############ +DOCLING_IMAGE=ghcr.io/docling-project/docling-serve:cpu + +########################################################################################## \ No newline at end of file diff --git a/Caddyfile b/Caddyfile index 4ba201c..17e1f52 100644 --- a/Caddyfile +++ b/Caddyfile @@ -140,6 +140,14 @@ https://{$NEO4J_HOSTNAME}:7687 { reverse_proxy paddleocr:8080 } +# Docling (Document Conversion API) +{$DOCLING_HOSTNAME} { + basic_auth { + {$DOCLING_USERNAME} {$DOCLING_PASSWORD_HASH} + } + reverse_proxy docling:5001 +} + import /etc/caddy/addons/*.conf # # SearXNG diff --git a/README.md b/README.md index 5c99d9e..cc7b690 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,8 @@ The installer also makes the following powerful open-source tools **available fo ✅ [**Crawl4ai**](https://github.com/unclecode/crawl4ai) - A flexible web crawler designed for AI, enabling you to extract data from websites for your projects. +✅ [**Docling**](https://github.com/docling-project/docling-serve) - Universal document converter that transforms PDF, DOCX, PPTX, XLSX, HTML, and images into clean Markdown or JSON. Features advanced PDF parsing, OCR support, and a REST API with optional web UI. Perfect for document processing in n8n workflows. + ✅ [**Dify**](https://dify.ai/) - An open-source AI application development platform that provides comprehensive LLMOps capabilities, including workflow management, prompt engineering, RAG pipelines, and AI agent orchestration. Perfect for building production-ready AI applications. ✅ [**Flowise**](https://flowiseai.com/) - A no-code/low-code AI agent builder that complements n8n perfectly, allowing you to create sophisticated AI applications with ease. diff --git a/docker-compose.yml b/docker-compose.yml index 433139e..f915a1d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -230,6 +230,9 @@ services: - COMFYUI_PASSWORD_HASH=${COMFYUI_PASSWORD_HASH} - COMFYUI_USERNAME=${COMFYUI_USERNAME} - DIFY_HOSTNAME=${DIFY_HOSTNAME} + - DOCLING_HOSTNAME=${DOCLING_HOSTNAME} + - DOCLING_PASSWORD_HASH=${DOCLING_PASSWORD_HASH} + - DOCLING_USERNAME=${DOCLING_USERNAME} - FLOWISE_HOSTNAME=${FLOWISE_HOSTNAME} - GRAFANA_HOSTNAME=${GRAFANA_HOSTNAME} - LANGFUSE_HOSTNAME=${LANGFUSE_HOSTNAME} @@ -1048,3 +1051,18 @@ services: timeout: 10s retries: 5 start_period: 60s + + docling: + image: ${DOCLING_IMAGE:-ghcr.io/docling-project/docling-serve:cpu} + container_name: docling + profiles: ["docling"] + restart: unless-stopped + environment: + - DOCLING_SERVE_ENABLE_UI=1 + shm_size: 1g + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://localhost:5001/docs > /dev/null || exit 1"] + interval: 30s + timeout: 10s + retries: 5 + start_period: 30s diff --git a/scripts/03_generate_secrets.sh b/scripts/03_generate_secrets.sh index 02c096e..13fc851 100644 --- a/scripts/03_generate_secrets.sh +++ b/scripts/03_generate_secrets.sh @@ -66,6 +66,8 @@ declare -A VARS_TO_GENERATE=( # LightRAG credentials ["LIGHTRAG_PASSWORD"]="password:32" ["LIGHTRAG_API_KEY"]="secret:48" + # Docling credentials + ["DOCLING_PASSWORD"]="password:32" ) # Initialize existing_env_vars and attempt to read .env if it exists @@ -274,6 +276,7 @@ generated_values["LT_USERNAME"]="$USER_EMAIL" # Set LibreTranslate username for generated_values["LIGHTRAG_USERNAME"]="$USER_EMAIL" # Set LightRAG username for built-in auth generated_values["WAHA_DASHBOARD_USERNAME"]="$USER_EMAIL" # WAHA dashboard username default generated_values["WHATSAPP_SWAGGER_USERNAME"]="$USER_EMAIL" # WAHA swagger username default +generated_values["DOCLING_USERNAME"]="$USER_EMAIL" # Set Docling username for Caddy # Create a temporary file for processing @@ -297,6 +300,7 @@ found_vars["NEO4J_AUTH_USERNAME"]=0 found_vars["COMFYUI_USERNAME"]=0 found_vars["RAGAPP_USERNAME"]=0 found_vars["PADDLEOCR_USERNAME"]=0 +found_vars["DOCLING_USERNAME"]=0 found_vars["LT_USERNAME"]=0 found_vars["LIGHTRAG_USERNAME"]=0 found_vars["WAHA_DASHBOARD_USERNAME"]=0 @@ -429,7 +433,7 @@ if [[ -z "${generated_values[SERVICE_ROLE_KEY]}" ]]; then fi # Add any custom variables that weren't found in the template -for var in "FLOWISE_USERNAME" "DASHBOARD_USERNAME" "LETSENCRYPT_EMAIL" "RUN_N8N_IMPORT" "OPENAI_API_KEY" "PROMETHEUS_USERNAME" "SEARXNG_USERNAME" "LANGFUSE_INIT_USER_EMAIL" "N8N_WORKER_COUNT" "WEAVIATE_USERNAME" "NEO4J_AUTH_USERNAME" "COMFYUI_USERNAME" "RAGAPP_USERNAME" "PADDLEOCR_USERNAME" "LT_USERNAME" "LIGHTRAG_USERNAME" "WAHA_DASHBOARD_USERNAME" "WHATSAPP_SWAGGER_USERNAME"; do +for var in "FLOWISE_USERNAME" "DASHBOARD_USERNAME" "LETSENCRYPT_EMAIL" "RUN_N8N_IMPORT" "OPENAI_API_KEY" "PROMETHEUS_USERNAME" "SEARXNG_USERNAME" "LANGFUSE_INIT_USER_EMAIL" "N8N_WORKER_COUNT" "WEAVIATE_USERNAME" "NEO4J_AUTH_USERNAME" "COMFYUI_USERNAME" "RAGAPP_USERNAME" "PADDLEOCR_USERNAME" "LT_USERNAME" "LIGHTRAG_USERNAME" "WAHA_DASHBOARD_USERNAME" "WHATSAPP_SWAGGER_USERNAME" "DOCLING_USERNAME"; do if [[ ${found_vars["$var"]} -eq 0 && -v generated_values["$var"] ]]; then # Before appending, check if it's already in TMP_ENV_FILE to avoid duplicates if ! grep -q -E "^${var}=" "$TMP_ENV_FILE"; then @@ -607,6 +611,18 @@ if [[ -z "$FINAL_LT_HASH" && -n "$LT_PLAIN_PASS" ]]; then fi _update_or_add_env_var "LT_PASSWORD_HASH" "$FINAL_LT_HASH" +# --- DOCLING --- +DOCLING_PLAIN_PASS="${generated_values["DOCLING_PASSWORD"]}" +FINAL_DOCLING_HASH="${generated_values[DOCLING_PASSWORD_HASH]}" +if [[ -z "$FINAL_DOCLING_HASH" && -n "$DOCLING_PLAIN_PASS" ]]; then + NEW_HASH=$(_generate_and_get_hash "$DOCLING_PLAIN_PASS") + if [[ -n "$NEW_HASH" ]]; then + FINAL_DOCLING_HASH="$NEW_HASH" + generated_values["DOCLING_PASSWORD_HASH"]="$NEW_HASH" + fi +fi +_update_or_add_env_var "DOCLING_PASSWORD_HASH" "$FINAL_DOCLING_HASH" + if [ $? -eq 0 ]; then # This $? reflects the status of the last mv command from the last _update_or_add_env_var call. # For now, assuming if we reached here and mv was fine, primary operations were okay. echo ".env file generated successfully in the project root ($OUTPUT_FILE)." diff --git a/scripts/04_wizard.sh b/scripts/04_wizard.sh index 15f0426..932ba63 100755 --- a/scripts/04_wizard.sh +++ b/scripts/04_wizard.sh @@ -53,6 +53,7 @@ base_services_data=( "cloudflare-tunnel" "Cloudflare Tunnel (Zero-Trust Secure Access)" "comfyui" "ComfyUI (Node-based Stable Diffusion UI)" "crawl4ai" "Crawl4ai (Web Crawler for AI)" + "docling" "Docling (Universal Document Converter to Markdown/JSON)" "dify" "Dify (AI Application Development Platform with LLMOps)" "flowise" "Flowise (AI Agent Builder)" "gotenberg" "Gotenberg (Document Conversion API)" diff --git a/scripts/07_final_report.sh b/scripts/07_final_report.sh index f395bdd..2bf904f 100644 --- a/scripts/07_final_report.sh +++ b/scripts/07_final_report.sh @@ -221,6 +221,31 @@ if is_profile_active "crawl4ai"; then echo "(Note: Not exposed externally via Caddy by default)" fi +if is_profile_active "docling"; then + echo + echo "================================= Docling =============================" + echo + echo "Host: ${DOCLING_HOSTNAME:-}" + echo "User: ${DOCLING_USERNAME:-}" + echo "Password: ${DOCLING_PASSWORD:-}" + echo "API (external via Caddy): https://${DOCLING_HOSTNAME:-}" + echo "API (internal): http://docling:5001" + echo "" + echo "Web UI: https://${DOCLING_HOSTNAME:-}/ui" + echo "API Docs: https://${DOCLING_HOSTNAME:-}/docs" + echo "" + echo "Configuration:" + echo " Docker Image: ${DOCLING_IMAGE:-ghcr.io/docling-project/docling-serve:cpu}" + echo "" + echo "Main API Endpoint:" + echo " POST /v1/convert/source" + echo " Body: {\"sources\": [{\"kind\": \"http\", \"url\": \"https://example.com/doc.pdf\"}]}" + echo "" + echo "Supported formats: PDF, DOCX, PPTX, XLSX, HTML, images" + echo "Output formats: Markdown, JSON, HTML" + echo "GitHub: https://github.com/docling-project/docling-serve" +fi + if is_profile_active "gotenberg"; then echo echo "================================= Gotenberg ============================"