Implementation:Infiniflow Ragflow Docker Env Configuration
Appearance
| Knowledge Sources | |
|---|---|
| Domains | DevOps, Configuration_Management |
| Last Updated | 2026-02-12 06:00 GMT |
Overview
Pattern documentation for configuring RAGFlow deployment via environment files and YAML templates.
Description
The docker/.env file controls Docker Compose behavior with variables for DOC_ENGINE (elasticsearch/infinity/oceanbase/opensearch), DEVICE (cpu/gpu), RAGFLOW_IMAGE, SVR_HTTP_PORT, and service passwords. The service_conf.yaml.template defines backend connections (MySQL, MinIO, Redis, Elasticsearch) with ${VAR:-default} substitution.
Usage
Edit docker/.env before running docker compose up. Change default passwords for production.
Code Reference
Source Location
- Repository: ragflow
- File: docker/.env (L1-279), docker/service_conf.yaml.template (L1-167)
Signature
# Key docker/.env variables
DOC_ENGINE=elasticsearch # elasticsearch|infinity|oceanbase|opensearch
DEVICE=cpu # cpu|gpu
RAGFLOW_IMAGE=infiniflow/ragflow:nightly
SVR_HTTP_PORT=9380
ELASTIC_PASSWORD=infini_rag_flow # CHANGE FOR PRODUCTION
MYSQL_PASSWORD=infini_rag_flow # CHANGE FOR PRODUCTION
MINIO_PASSWORD=infini_rag_flow # CHANGE FOR PRODUCTION
REDIS_PASSWORD=infini_rag_flow # CHANGE FOR PRODUCTION
Import
# Configuration files - edit directly, no import
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| .env file | file | Yes | Docker Compose environment variables |
| service_conf.yaml.template | file | Yes | Backend configuration template |
Outputs
| Name | Type | Description |
|---|---|---|
| Environment variables | env | Loaded by Docker Compose |
| service_conf.yaml | file | Generated at container startup via envsubst |
Usage Examples
# Edit environment configuration
cd docker
cp .env .env.backup
# Configure for production with Infinity engine and GPU
sed -i 's/DOC_ENGINE=elasticsearch/DOC_ENGINE=infinity/' .env
sed -i 's/DEVICE=cpu/DEVICE=gpu/' .env
sed -i 's/ELASTIC_PASSWORD=infini_rag_flow/ELASTIC_PASSWORD=my_secure_password/' .env
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment