Files
runtipi/apps/ragflow/docker-compose.json

197 lines
6.5 KiB
JSON

{
"schemaVersion": 2,
"$schema": "https://schemas.runtipi.io/v2/dynamic-compose.json",
"services": [
{
"name": "ragflow-es-init",
"image": "busybox:1.36",
"isMain": false,
"restart": "no",
"user": "root",
"command": ["chown", "-R", "1000:0", "/usr/share/elasticsearch/data"],
"volumes": [
{
"hostPath": "${APP_DATA_DIR}/data/es",
"containerPath": "/usr/share/elasticsearch/data",
"readOnly": false
}
]
},
{
"name": "ragflow-es01",
"image": "elasticsearch:8.11.3",
"environment": [
{ "key": "node.name", "value": "es01" },
{ "key": "ELASTIC_PASSWORD", "value": "${RAGFLOW_ELASTIC_PASSWORD}" },
{ "key": "bootstrap.memory_lock", "value": "false" },
{ "key": "discovery.type", "value": "single-node" },
{ "key": "xpack.security.enabled", "value": "true" },
{ "key": "xpack.security.http.ssl.enabled", "value": "false" },
{ "key": "xpack.security.transport.ssl.enabled", "value": "false" },
{ "key": "cluster.routing.allocation.disk.watermark.low", "value": "5gb" },
{ "key": "cluster.routing.allocation.disk.watermark.high", "value": "3gb" },
{ "key": "cluster.routing.allocation.disk.watermark.flood_stage", "value": "2gb" },
{ "key": "ES_JAVA_OPTS", "value": "-Xms2g -Xmx4g" }
],
"volumes": [
{
"hostPath": "${APP_DATA_DIR}/data/es",
"containerPath": "/usr/share/elasticsearch/data",
"readOnly": false
}
],
"ulimits": {
"memlock": { "soft": -1, "hard": -1 }
},
"deploy": {
"resources": {
"limits": {
"memory": "8000M"
}
}
},
"dependsOn": {
"ragflow-es-init": { "condition": "service_completed_successfully" }
},
"healthCheck": {
"test": "curl http://127.0.0.1:9200 || exit 1",
"interval": "10s",
"timeout": "10s",
"retries": 120,
"startPeriod": "120s"
}
},
{
"name": "ragflow-mysql",
"image": "mysql:8.0.39",
"environment": [
{ "key": "MYSQL_ROOT_PASSWORD", "value": "${RAGFLOW_MYSQL_ROOT_PASSWORD}" },
{ "key": "MYSQL_DATABASE", "value": "rag_flow" }
],
"command": [
"mysqld",
"--max_connections=1000",
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_unicode_ci",
"--default-authentication-plugin=mysql_native_password",
"--tls_version=TLSv1.2,TLSv1.3",
"--binlog_expire_logs_seconds=604800"
],
"volumes": [
{
"hostPath": "${APP_DATA_DIR}/data/mysql",
"containerPath": "/var/lib/mysql",
"readOnly": false
}
],
"healthCheck": {
"test": "mysqladmin ping -uroot -p${RAGFLOW_MYSQL_ROOT_PASSWORD}",
"interval": "10s",
"timeout": "10s",
"retries": 60,
"startPeriod": "30s"
}
},
{
"name": "ragflow-minio",
"image": "pgsty/minio:RELEASE.2026-03-25T00-00-00Z",
"command": ["server", "--console-address", ":9001", "/data"],
"environment": [
{ "key": "MINIO_ROOT_USER", "value": "rag_flow" },
{ "key": "MINIO_ROOT_PASSWORD", "value": "${RAGFLOW_MINIO_ROOT_PASSWORD}" }
],
"volumes": [
{
"hostPath": "${APP_DATA_DIR}/data/minio",
"containerPath": "/data",
"readOnly": false
}
],
"healthCheck": {
"test": "curl -f http://127.0.0.1:9000/minio/health/live || exit 1",
"interval": "10s",
"timeout": "10s",
"retries": 60,
"startPeriod": "30s"
}
},
{
"name": "ragflow-redis",
"image": "valkey/valkey:8.0.2",
"command": [
"redis-server",
"--requirepass", "${RAGFLOW_REDIS_PASSWORD}",
"--maxmemory", "128mb",
"--maxmemory-policy", "allkeys-lru"
],
"volumes": [
{
"hostPath": "${APP_DATA_DIR}/data/redis",
"containerPath": "/data",
"readOnly": false
}
],
"healthCheck": {
"test": "redis-cli -a ${RAGFLOW_REDIS_PASSWORD} ping",
"interval": "10s",
"timeout": "10s",
"retries": 30,
"startPeriod": "15s"
}
},
{
"name": "ragflow-server",
"image": "infiniflow/ragflow:v0.26.4",
"isMain": true,
"internalPort": 80,
"entrypoint": [
"/bin/bash",
"-c",
"if [ \"$RAGFLOW_REGISTER_ENABLED\" = \"false\" ]; then export REGISTER_ENABLED=0; else export REGISTER_ENABLED=1; fi; exec ./entrypoint.sh \"$@\"",
"bash"
],
"command": ["--enable-adminserver", "--init-model-provider-tables"],
"environment": [
{ "key": "TZ", "value": "${TZ}" },
{ "key": "DOC_ENGINE", "value": "elasticsearch" },
{ "key": "ES_HOST", "value": "ragflow-es01" },
{ "key": "ELASTIC_PASSWORD", "value": "${RAGFLOW_ELASTIC_PASSWORD}" },
{ "key": "MYSQL_HOST", "value": "ragflow-mysql" },
{ "key": "MYSQL_PORT", "value": "3306" },
{ "key": "MYSQL_DBNAME", "value": "rag_flow" },
{ "key": "MYSQL_PASSWORD", "value": "${RAGFLOW_MYSQL_ROOT_PASSWORD}" },
{ "key": "MINIO_HOST", "value": "ragflow-minio" },
{ "key": "MINIO_USER", "value": "rag_flow" },
{ "key": "MINIO_PASSWORD", "value": "${RAGFLOW_MINIO_ROOT_PASSWORD}" },
{ "key": "REDIS_HOST", "value": "ragflow-redis" },
{ "key": "REDIS_PASSWORD", "value": "${RAGFLOW_REDIS_PASSWORD}" },
{ "key": "RAGFLOW_SECRET_KEY", "value": "${RAGFLOW_SECRET_KEY}" },
{ "key": "RAGFLOW_REGISTER_ENABLED", "value": "${RAGFLOW_REGISTER_ENABLED}" },
{ "key": "API_PROXY_SCHEME", "value": "python" },
{ "key": "USE_DOCLING", "value": "false" },
{ "key": "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT", "value": "1" }
],
"volumes": [
{
"hostPath": "${APP_DATA_DIR}/data/logs",
"containerPath": "/ragflow/logs",
"readOnly": false
}
],
"dependsOn": {
"ragflow-es01": { "condition": "service_healthy" },
"ragflow-mysql": { "condition": "service_healthy" },
"ragflow-minio": { "condition": "service_healthy" },
"ragflow-redis": { "condition": "service_healthy" }
},
"healthCheck": {
"test": "curl -f http://127.0.0.1:80/ || exit 1",
"interval": "30s",
"timeout": "10s",
"retries": 10,
"startPeriod": "180s"
}
}
]
}