diff --git a/.env.example b/.env.example index 4ecafa2..e9650a6 100644 --- a/.env.example +++ b/.env.example @@ -157,6 +157,7 @@ POSTIZ_HOSTNAME=postiz.yourdomain.com PROMETHEUS_HOSTNAME=prometheus.yourdomain.com QDRANT_HOSTNAME=qdrant.yourdomain.com RAGAPP_HOSTNAME=ragapp.yourdomain.com +RAGFLOW_HOSTNAME=ragflow.yourdomain.com SEARXNG_HOSTNAME=searxng.yourdomain.com SUPABASE_HOSTNAME=supabase.yourdomain.com WEAVIATE_HOSTNAME=weaviate.yourdomain.com @@ -465,3 +466,10 @@ WAHA_DASHBOARD_PASSWORD= # Swagger credentials WHATSAPP_SWAGGER_USERNAME= WHATSAPP_SWAGGER_PASSWORD= + +############ +# [required] +# RAGFlow internal credentials (for MySQL and MinIO) +############ +RAGFLOW_MYSQL_ROOT_PASSWORD= +RAGFLOW_MINIO_ROOT_PASSWORD= diff --git a/Caddyfile b/Caddyfile index e057928..6e8d3ea 100644 --- a/Caddyfile +++ b/Caddyfile @@ -33,6 +33,11 @@ reverse_proxy ragapp:8000 } +# RAGFlow +{$RAGFLOW_HOSTNAME} { + reverse_proxy ragflow:80 +} + # Langfuse {$LANGFUSE_HOSTNAME} { reverse_proxy langfuse-web:3000 diff --git a/README.md b/README.md index a61ebdf..1c614db 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,8 @@ The installer also makes the following powerful open-source tools **available fo ✅ [**RAGApp**](https://github.com/ragapp/ragapp) - Open-source application to build Retrieval-Augmented Generation (RAG) assistants over your data. Provides a web UI for chat and an HTTP API for integration with your workflows. +✅ [**RAGFlow**](https://ragflow.io/) - An open-source RAG engine based on deep document understanding, providing truthful question-answering capabilities with well-founded citations from complex formatted data. + ✅ [**SearXNG**](https://searxng.org/) - A free, open-source internet metasearch engine. It aggregates results from numerous search services without tracking or profiling you, ensuring your privacy. ✅ [**Supabase**](https://supabase.com/) - An open-source alternative to Firebase, providing database storage, user authentication, and more. It's a popular choice for AI applications. @@ -152,6 +154,7 @@ After successful installation, your services are up and running! Here's how to g - **Prometheus:** `prometheus.yourdomain.com` (Typically used as a data source for Grafana) - **Qdrant:** `qdrant.yourdomain.com` - **RAGApp:** `ragapp.yourdomain.com` + - **RAGFlow:** `ragflow.yourdomain.com` - **SearXNG:** `searxng.yourdomain.com` - **Supabase (Dashboard):** `supabase.yourdomain.com` - **WAHA:** `waha.yourdomain.com` (WhatsApp HTTP API; engines: WEBJS, NOWEB, GOWS) diff --git a/docker-compose.yml b/docker-compose.yml index a32703e..b66cb97 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,9 @@ volumes: postiz-uploads: prometheus_data: qdrant_storage: + ragflow_es_data: + ragflow_minio_data: + ragflow_mysql_data: valkey-data: weaviate_data: @@ -245,6 +248,7 @@ services: - PROMETHEUS_USERNAME=${PROMETHEUS_USERNAME} - QDRANT_HOSTNAME=${QDRANT_HOSTNAME} - RAGAPP_HOSTNAME=${RAGAPP_HOSTNAME} + - RAGFLOW_HOSTNAME=${RAGFLOW_HOSTNAME} - RAGAPP_PASSWORD_HASH=${RAGAPP_PASSWORD_HASH} - RAGAPP_USERNAME=${RAGAPP_USERNAME} - SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME} @@ -806,3 +810,100 @@ services: condition: service_healthy postgres: condition: service_healthy + + ragflow: + image: infiniflow/ragflow:v0.21.1-slim + container_name: ragflow + profiles: ["ragflow"] + restart: unless-stopped + environment: + - SVR_HTTP_PORT=80 + - REDIS_HOST=redis + - REDIS_PORT=6379 + - MYSQL_HOST=ragflow-mysql + - MYSQL_PORT=3306 + - MYSQL_USER=root + - MYSQL_PASSWORD=${RAGFLOW_MYSQL_ROOT_PASSWORD} + - MYSQL_DATABASE=ragflow + - ES_HOST=ragflow-es + - ES_PORT=9200 + - MINIO_HOST=ragflow-minio + - MINIO_PORT=9000 + - MINIO_ACCESS_KEY=minio + - MINIO_SECRET_KEY=${RAGFLOW_MINIO_ROOT_PASSWORD} + - MINIO_BUCKET=ragflow + depends_on: + ragflow-mysql: + condition: service_healthy + ragflow-es: + condition: service_healthy + ragflow-minio: + condition: service_healthy + redis: + condition: service_healthy + + ragflow-mysql: + image: mysql:8 + container_name: ragflow-mysql + profiles: ["ragflow"] + restart: unless-stopped + environment: + - MYSQL_ROOT_PASSWORD=${RAGFLOW_MYSQL_ROOT_PASSWORD} + - MYSQL_DATABASE=ragflow + healthcheck: + test: ["CMD-SHELL", "mysqladmin ping -h localhost || exit 1"] + interval: 10s + timeout: 5s + retries: 10 + start_period: 30s + volumes: + - ragflow_mysql_data:/var/lib/mysql + + ragflow-es: + image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3 + container_name: ragflow-es + profiles: ["ragflow"] + restart: unless-stopped + environment: + - discovery.type=single-node + - xpack.security.enabled=false + - ES_JAVA_OPTS=-Xms1g -Xmx1g + - bootstrap.memory_lock=true + ulimits: + memlock: + soft: -1 + hard: -1 + nofile: + soft: 65536 + hard: 65536 + healthcheck: + test: + [ + "CMD-SHELL", + "wget -qO- http://localhost:9200 >/dev/null 2>&1 || exit 1", + ] + interval: 10s + timeout: 5s + retries: 10 + start_period: 60s + volumes: + - ragflow_es_data:/usr/share/elasticsearch/data + + ragflow-minio: + image: minio/minio + container_name: ragflow-minio + profiles: ["ragflow"] + restart: unless-stopped + entrypoint: sh + command: -c 'mkdir -p /data/ragflow && minio server --address ":9000" --console-address ":9001" /data' + environment: + - MINIO_ROOT_USER=minio + - MINIO_ROOT_PASSWORD=${RAGFLOW_MINIO_ROOT_PASSWORD} + healthcheck: + test: ["CMD", "mc", "ready", "local"] + interval: 5s + timeout: 5s + retries: 10 + start_period: 10s + volumes: + - ragflow_minio_data:/data diff --git a/scripts/01_system_preparation.sh b/scripts/01_system_preparation.sh index 3d86b68..eb8f841 100755 --- a/scripts/01_system_preparation.sh +++ b/scripts/01_system_preparation.sh @@ -46,4 +46,15 @@ apt install -y unattended-upgrades # Automatic confirmation for dpkg-reconfigure echo "y" | dpkg-reconfigure --priority=low unattended-upgrades +# Set vm.max_map_count for Elasticsearch (required for RAGFlow if using ES backend) +log_info "Configuring vm.max_map_count for Elasticsearch support..." +if [ -f /etc/sysctl.conf ]; then + if ! grep -q "^vm.max_map_count" /etc/sysctl.conf; then + echo "vm.max_map_count=262144" >> /etc/sysctl.conf + log_info "Added vm.max_map_count=262144 to /etc/sysctl.conf" + fi +fi +# Apply immediately +sysctl -w vm.max_map_count=262144 > /dev/null 2>&1 || true + exit 0 \ No newline at end of file diff --git a/scripts/03_generate_secrets.sh b/scripts/03_generate_secrets.sh index 6ba50e2..5776aa8 100644 --- a/scripts/03_generate_secrets.sh +++ b/scripts/03_generate_secrets.sh @@ -58,6 +58,9 @@ declare -A VARS_TO_GENERATE=( # WAHA (WhatsApp HTTP API) ["WAHA_DASHBOARD_PASSWORD"]="password:32" ["WHATSAPP_SWAGGER_PASSWORD"]="password:32" + # RAGFlow internal credentials + ["RAGFLOW_MYSQL_ROOT_PASSWORD"]="password:32" + ["RAGFLOW_MINIO_ROOT_PASSWORD"]="password:32" ) # Initialize existing_env_vars and attempt to read .env if it exists diff --git a/scripts/04_wizard.sh b/scripts/04_wizard.sh index 5ec4f08..eba5019 100755 --- a/scripts/04_wizard.sh +++ b/scripts/04_wizard.sh @@ -71,6 +71,7 @@ base_services_data=( "python-runner" "Python Runner (Run your custom Python code from ./python-runner)" "qdrant" "Qdrant (Vector Database)" "ragapp" "RAGApp (Open-source RAG UI + API)" + "ragflow" "RAGFlow (Deep document understanding RAG engine)" "searxng" "SearXNG (Private Metasearch Engine)" "supabase" "Supabase (Backend as a Service)" "waha" "WAHA – WhatsApp HTTP API (NOWEB engine)" diff --git a/scripts/07_final_report.sh b/scripts/07_final_report.sh index 76238a0..c4eb614 100644 --- a/scripts/07_final_report.sh +++ b/scripts/07_final_report.sh @@ -172,6 +172,16 @@ if is_profile_active "ragapp"; then echo "API Docs: https://${RAGAPP_HOSTNAME:-}/docs" fi +if is_profile_active "ragflow"; then + echo + echo "================================= RAGFlow =============================" + echo + echo "Host: ${RAGFLOW_HOSTNAME:-}" + echo "API (external via Caddy): https://${RAGFLOW_HOSTNAME:-}" + echo "API (internal): http://ragflow:80" + echo "Note: Uses built-in authentication (login/registration available in web UI)" +fi + if is_profile_active "comfyui"; then echo echo "================================= ComfyUI ============================="