docker-compose.yaml 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. x-shared-env: &shared-api-worker-env
  2. WORKFLOW_FILE_UPLOAD_LIMIT: ${WORKFLOW_FILE_UPLOAD_LIMIT:-10}
  3. LOG_LEVEL: ${LOG_LEVEL:-INFO}
  4. LOG_FILE: ${LOG_FILE:-}
  5. LOG_FILE_MAX_SIZE: ${LOG_FILE_MAX_SIZE:-20}
  6. LOG_FILE_BACKUP_COUNT: ${LOG_FILE_BACKUP_COUNT:-5}
  7. # Log dateformat
  8. LOG_DATEFORMAT: ${LOG_DATEFORMAT:-%Y-%m-%d %H:%M:%S}
  9. # Log Timezone
  10. LOG_TZ: ${LOG_TZ:-UTC}
  11. DEBUG: ${DEBUG:-false}
  12. FLASK_DEBUG: ${FLASK_DEBUG:-false}
  13. SECRET_KEY: ${SECRET_KEY:-sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U}
  14. INIT_PASSWORD: ${INIT_PASSWORD:-}
  15. CONSOLE_WEB_URL: ${CONSOLE_WEB_URL:-}
  16. CONSOLE_API_URL: ${CONSOLE_API_URL:-}
  17. SERVICE_API_URL: ${SERVICE_API_URL:-}
  18. APP_WEB_URL: ${APP_WEB_URL:-}
  19. CHECK_UPDATE_URL: ${CHECK_UPDATE_URL:-https://updates.dify.ai}
  20. OPENAI_API_BASE: ${OPENAI_API_BASE:-https://api.openai.com/v1}
  21. FILES_URL: ${FILES_URL:-}
  22. FILES_ACCESS_TIMEOUT: ${FILES_ACCESS_TIMEOUT:-300}
  23. APP_MAX_ACTIVE_REQUESTS: ${APP_MAX_ACTIVE_REQUESTS:-0}
  24. MIGRATION_ENABLED: ${MIGRATION_ENABLED:-true}
  25. DEPLOY_ENV: ${DEPLOY_ENV:-PRODUCTION}
  26. DIFY_BIND_ADDRESS: ${DIFY_BIND_ADDRESS:-0.0.0.0}
  27. DIFY_PORT: ${DIFY_PORT:-5001}
  28. SERVER_WORKER_AMOUNT: ${SERVER_WORKER_AMOUNT:-}
  29. SERVER_WORKER_CLASS: ${SERVER_WORKER_CLASS:-}
  30. CELERY_WORKER_CLASS: ${CELERY_WORKER_CLASS:-}
  31. GUNICORN_TIMEOUT: ${GUNICORN_TIMEOUT:-360}
  32. CELERY_WORKER_AMOUNT: ${CELERY_WORKER_AMOUNT:-}
  33. CELERY_AUTO_SCALE: ${CELERY_AUTO_SCALE:-false}
  34. CELERY_MAX_WORKERS: ${CELERY_MAX_WORKERS:-}
  35. CELERY_MIN_WORKERS: ${CELERY_MIN_WORKERS:-}
  36. API_TOOL_DEFAULT_CONNECT_TIMEOUT: ${API_TOOL_DEFAULT_CONNECT_TIMEOUT:-10}
  37. API_TOOL_DEFAULT_READ_TIMEOUT: ${API_TOOL_DEFAULT_READ_TIMEOUT:-60}
  38. DB_USERNAME: ${DB_USERNAME:-postgres}
  39. DB_PASSWORD: ${DB_PASSWORD:-difyai123456}
  40. DB_HOST: ${DB_HOST:-db}
  41. DB_PORT: ${DB_PORT:-5432}
  42. DB_DATABASE: ${DB_DATABASE:-dify}
  43. SQLALCHEMY_POOL_SIZE: ${SQLALCHEMY_POOL_SIZE:-30}
  44. SQLALCHEMY_POOL_RECYCLE: ${SQLALCHEMY_POOL_RECYCLE:-3600}
  45. SQLALCHEMY_ECHO: ${SQLALCHEMY_ECHO:-false}
  46. REDIS_HOST: ${REDIS_HOST:-redis}
  47. REDIS_PORT: ${REDIS_PORT:-6379}
  48. REDIS_USERNAME: ${REDIS_USERNAME:-}
  49. REDIS_PASSWORD: ${REDIS_PASSWORD:-difyai123456}
  50. REDIS_USE_SSL: ${REDIS_USE_SSL:-false}
  51. REDIS_DB: ${REDIS_DB:-0}
  52. REDIS_USE_SENTINEL: ${REDIS_USE_SENTINEL:-false}
  53. REDIS_SENTINELS: ${REDIS_SENTINELS:-}
  54. REDIS_SENTINEL_SERVICE_NAME: ${REDIS_SENTINEL_SERVICE_NAME:-}
  55. REDIS_SENTINEL_USERNAME: ${REDIS_SENTINEL_USERNAME:-}
  56. REDIS_SENTINEL_PASSWORD: ${REDIS_SENTINEL_PASSWORD:-}
  57. REDIS_SENTINEL_SOCKET_TIMEOUT: ${REDIS_SENTINEL_SOCKET_TIMEOUT:-0.1}
  58. ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-60}
  59. CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://:difyai123456@redis:6379/1}
  60. BROKER_USE_SSL: ${BROKER_USE_SSL:-false}
  61. CELERY_USE_SENTINEL: ${CELERY_USE_SENTINEL:-false}
  62. CELERY_SENTINEL_MASTER_NAME: ${CELERY_SENTINEL_MASTER_NAME:-}
  63. CELERY_SENTINEL_SOCKET_TIMEOUT: ${CELERY_SENTINEL_SOCKET_TIMEOUT:-0.1}
  64. WEB_API_CORS_ALLOW_ORIGINS: ${WEB_API_CORS_ALLOW_ORIGINS:-*}
  65. CONSOLE_CORS_ALLOW_ORIGINS: ${CONSOLE_CORS_ALLOW_ORIGINS:-*}
  66. STORAGE_TYPE: ${STORAGE_TYPE:-local}
  67. STORAGE_LOCAL_PATH: ${STORAGE_LOCAL_PATH:-storage}
  68. S3_USE_AWS_MANAGED_IAM: ${S3_USE_AWS_MANAGED_IAM:-false}
  69. S3_ENDPOINT: ${S3_ENDPOINT:-}
  70. S3_BUCKET_NAME: ${S3_BUCKET_NAME:-}
  71. S3_ACCESS_KEY: ${S3_ACCESS_KEY:-}
  72. S3_SECRET_KEY: ${S3_SECRET_KEY:-}
  73. S3_REGION: ${S3_REGION:-us-east-1}
  74. AZURE_BLOB_ACCOUNT_NAME: ${AZURE_BLOB_ACCOUNT_NAME:-}
  75. AZURE_BLOB_ACCOUNT_KEY: ${AZURE_BLOB_ACCOUNT_KEY:-}
  76. AZURE_BLOB_CONTAINER_NAME: ${AZURE_BLOB_CONTAINER_NAME:-}
  77. AZURE_BLOB_ACCOUNT_URL: ${AZURE_BLOB_ACCOUNT_URL:-}
  78. GOOGLE_STORAGE_BUCKET_NAME: ${GOOGLE_STORAGE_BUCKET_NAME:-}
  79. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: ${GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64:-}
  80. ALIYUN_OSS_BUCKET_NAME: ${ALIYUN_OSS_BUCKET_NAME:-}
  81. ALIYUN_OSS_ACCESS_KEY: ${ALIYUN_OSS_ACCESS_KEY:-}
  82. ALIYUN_OSS_SECRET_KEY: ${ALIYUN_OSS_SECRET_KEY:-}
  83. ALIYUN_OSS_ENDPOINT: ${ALIYUN_OSS_ENDPOINT:-}
  84. ALIYUN_OSS_REGION: ${ALIYUN_OSS_REGION:-}
  85. ALIYUN_OSS_AUTH_VERSION: ${ALIYUN_OSS_AUTH_VERSION:-v4}
  86. ALIYUN_OSS_PATH: ${ALIYUN_OSS_PATH:-}
  87. TENCENT_COS_BUCKET_NAME: ${TENCENT_COS_BUCKET_NAME:-}
  88. TENCENT_COS_SECRET_KEY: ${TENCENT_COS_SECRET_KEY:-}
  89. TENCENT_COS_SECRET_ID: ${TENCENT_COS_SECRET_ID:-}
  90. TENCENT_COS_REGION: ${TENCENT_COS_REGION:-}
  91. TENCENT_COS_SCHEME: ${TENCENT_COS_SCHEME:-}
  92. HUAWEI_OBS_BUCKET_NAME: ${HUAWEI_OBS_BUCKET_NAME:-}
  93. HUAWEI_OBS_SECRET_KEY: ${HUAWEI_OBS_SECRET_KEY:-}
  94. HUAWEI_OBS_ACCESS_KEY: ${HUAWEI_OBS_ACCESS_KEY:-}
  95. HUAWEI_OBS_SERVER: ${HUAWEI_OBS_SERVER:-}
  96. OCI_ENDPOINT: ${OCI_ENDPOINT:-}
  97. OCI_BUCKET_NAME: ${OCI_BUCKET_NAME:-}
  98. OCI_ACCESS_KEY: ${OCI_ACCESS_KEY:-}
  99. OCI_SECRET_KEY: ${OCI_SECRET_KEY:-}
  100. OCI_REGION: ${OCI_REGION:-}
  101. VOLCENGINE_TOS_BUCKET_NAME: ${VOLCENGINE_TOS_BUCKET_NAME:-}
  102. VOLCENGINE_TOS_SECRET_KEY: ${VOLCENGINE_TOS_SECRET_KEY:-}
  103. VOLCENGINE_TOS_ACCESS_KEY: ${VOLCENGINE_TOS_ACCESS_KEY:-}
  104. VOLCENGINE_TOS_ENDPOINT: ${VOLCENGINE_TOS_ENDPOINT:-}
  105. VOLCENGINE_TOS_REGION: ${VOLCENGINE_TOS_REGION:-}
  106. BAIDU_OBS_BUCKET_NAME: ${BAIDU_OBS_BUCKET_NAME:-}
  107. BAIDU_OBS_SECRET_KEY: ${BAIDU_OBS_SECRET_KEY:-}
  108. BAIDU_OBS_ACCESS_KEY: ${BAIDU_OBS_ACCESS_KEY:-}
  109. BAIDU_OBS_ENDPOINT: ${BAIDU_OBS_ENDPOINT:-}
  110. VECTOR_STORE: ${VECTOR_STORE:-weaviate}
  111. WEAVIATE_ENDPOINT: ${WEAVIATE_ENDPOINT:-http://weaviate:8080}
  112. WEAVIATE_API_KEY: ${WEAVIATE_API_KEY:-WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih}
  113. QDRANT_URL: ${QDRANT_URL:-http://qdrant:6333}
  114. QDRANT_API_KEY: ${QDRANT_API_KEY:-difyai123456}
  115. QDRANT_CLIENT_TIMEOUT: ${QDRANT_CLIENT_TIMEOUT:-20}
  116. QDRANT_GRPC_ENABLED: ${QDRANT_GRPC_ENABLED:-false}
  117. QDRANT_GRPC_PORT: ${QDRANT_GRPC_PORT:-6334}
  118. COUCHBASE_CONNECTION_STRING: ${COUCHBASE_CONNECTION_STRING:-'couchbase-server'}
  119. COUCHBASE_USER: ${COUCHBASE_USER:-Administrator}
  120. COUCHBASE_PASSWORD: ${COUCHBASE_PASSWORD:-password}
  121. COUCHBASE_BUCKET_NAME: ${COUCHBASE_BUCKET_NAME:-Embeddings}
  122. COUCHBASE_SCOPE_NAME: ${COUCHBASE_SCOPE_NAME:-_default}
  123. MILVUS_URI: ${MILVUS_URI:-http://127.0.0.1:19530}
  124. MILVUS_TOKEN: ${MILVUS_TOKEN:-}
  125. MILVUS_USER: ${MILVUS_USER:-root}
  126. MILVUS_PASSWORD: ${MILVUS_PASSWORD:-Milvus}
  127. MYSCALE_HOST: ${MYSCALE_HOST:-myscale}
  128. MYSCALE_PORT: ${MYSCALE_PORT:-8123}
  129. MYSCALE_USER: ${MYSCALE_USER:-default}
  130. MYSCALE_PASSWORD: ${MYSCALE_PASSWORD:-}
  131. MYSCALE_DATABASE: ${MYSCALE_DATABASE:-dify}
  132. MYSCALE_FTS_PARAMS: ${MYSCALE_FTS_PARAMS:-}
  133. RELYT_HOST: ${RELYT_HOST:-db}
  134. RELYT_PORT: ${RELYT_PORT:-5432}
  135. RELYT_USER: ${RELYT_USER:-postgres}
  136. RELYT_PASSWORD: ${RELYT_PASSWORD:-difyai123456}
  137. RELYT_DATABASE: ${RELYT_DATABASE:-postgres}
  138. PGVECTOR_HOST: ${PGVECTOR_HOST:-pgvector}
  139. PGVECTOR_PORT: ${PGVECTOR_PORT:-5432}
  140. PGVECTOR_USER: ${PGVECTOR_USER:-postgres}
  141. PGVECTOR_PASSWORD: ${PGVECTOR_PASSWORD:-difyai123456}
  142. PGVECTOR_DATABASE: ${PGVECTOR_DATABASE:-dify}
  143. TIDB_VECTOR_HOST: ${TIDB_VECTOR_HOST:-tidb}
  144. TIDB_VECTOR_PORT: ${TIDB_VECTOR_PORT:-4000}
  145. TIDB_VECTOR_USER: ${TIDB_VECTOR_USER:-}
  146. TIDB_VECTOR_PASSWORD: ${TIDB_VECTOR_PASSWORD:-}
  147. TIDB_VECTOR_DATABASE: ${TIDB_VECTOR_DATABASE:-dify}
  148. TIDB_ON_QDRANT_URL: ${TIDB_ON_QDRANT_URL:-http://127.0.0.1}
  149. TIDB_ON_QDRANT_API_KEY: ${TIDB_ON_QDRANT_API_KEY:-dify}
  150. TIDB_ON_QDRANT_CLIENT_TIMEOUT: ${TIDB_ON_QDRANT_CLIENT_TIMEOUT:-20}
  151. TIDB_ON_QDRANT_GRPC_ENABLED: ${TIDB_ON_QDRANT_GRPC_ENABLED:-false}
  152. TIDB_ON_QDRANT_GRPC_PORT: ${TIDB_ON_QDRANT_GRPC_PORT:-6334}
  153. TIDB_PUBLIC_KEY: ${TIDB_PUBLIC_KEY:-dify}
  154. TIDB_PRIVATE_KEY: ${TIDB_PRIVATE_KEY:-dify}
  155. TIDB_API_URL: ${TIDB_API_URL:-http://127.0.0.1}
  156. TIDB_IAM_API_URL: ${TIDB_IAM_API_URL:-http://127.0.0.1}
  157. TIDB_REGION: ${TIDB_REGION:-regions/aws-us-east-1}
  158. TIDB_PROJECT_ID: ${TIDB_PROJECT_ID:-dify}
  159. TIDB_SPEND_LIMIT: ${TIDB_SPEND_LIMIT:-100}
  160. ORACLE_HOST: ${ORACLE_HOST:-oracle}
  161. ORACLE_PORT: ${ORACLE_PORT:-1521}
  162. ORACLE_USER: ${ORACLE_USER:-dify}
  163. ORACLE_PASSWORD: ${ORACLE_PASSWORD:-dify}
  164. ORACLE_DATABASE: ${ORACLE_DATABASE:-FREEPDB1}
  165. CHROMA_HOST: ${CHROMA_HOST:-127.0.0.1}
  166. CHROMA_PORT: ${CHROMA_PORT:-8000}
  167. CHROMA_TENANT: ${CHROMA_TENANT:-default_tenant}
  168. CHROMA_DATABASE: ${CHROMA_DATABASE:-default_database}
  169. CHROMA_AUTH_PROVIDER: ${CHROMA_AUTH_PROVIDER:-chromadb.auth.token_authn.TokenAuthClientProvider}
  170. CHROMA_AUTH_CREDENTIALS: ${CHROMA_AUTH_CREDENTIALS:-}
  171. ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:-0.0.0.0}
  172. ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT:-9200}
  173. ELASTICSEARCH_USERNAME: ${ELASTICSEARCH_USERNAME:-elastic}
  174. ELASTICSEARCH_PASSWORD: ${ELASTICSEARCH_PASSWORD:-elastic}
  175. LINDORM_URL: ${LINDORM_URL:-http://lindorm:30070}
  176. LINDORM_USERNAME: ${LINDORM_USERNAME:-lindorm}
  177. LINDORM_PASSWORD: ${LINDORM_USERNAME:-lindorm }
  178. KIBANA_PORT: ${KIBANA_PORT:-5601}
  179. # AnalyticDB configuration
  180. ANALYTICDB_KEY_ID: ${ANALYTICDB_KEY_ID:-}
  181. ANALYTICDB_KEY_SECRET: ${ANALYTICDB_KEY_SECRET:-}
  182. ANALYTICDB_REGION_ID: ${ANALYTICDB_REGION_ID:-}
  183. ANALYTICDB_INSTANCE_ID: ${ANALYTICDB_INSTANCE_ID:-}
  184. ANALYTICDB_ACCOUNT: ${ANALYTICDB_ACCOUNT:-}
  185. ANALYTICDB_PASSWORD: ${ANALYTICDB_PASSWORD:-}
  186. ANALYTICDB_NAMESPACE: ${ANALYTICDB_NAMESPACE:-dify}
  187. ANALYTICDB_NAMESPACE_PASSWORD: ${ANALYTICDB_NAMESPACE_PASSWORD:-}
  188. OPENSEARCH_HOST: ${OPENSEARCH_HOST:-opensearch}
  189. OPENSEARCH_PORT: ${OPENSEARCH_PORT:-9200}
  190. OPENSEARCH_USER: ${OPENSEARCH_USER:-admin}
  191. OPENSEARCH_PASSWORD: ${OPENSEARCH_PASSWORD:-admin}
  192. OPENSEARCH_SECURE: ${OPENSEARCH_SECURE:-true}
  193. TENCENT_VECTOR_DB_URL: ${TENCENT_VECTOR_DB_URL:-http://127.0.0.1}
  194. TENCENT_VECTOR_DB_API_KEY: ${TENCENT_VECTOR_DB_API_KEY:-dify}
  195. TENCENT_VECTOR_DB_TIMEOUT: ${TENCENT_VECTOR_DB_TIMEOUT:-30}
  196. TENCENT_VECTOR_DB_USERNAME: ${TENCENT_VECTOR_DB_USERNAME:-dify}
  197. TENCENT_VECTOR_DB_DATABASE: ${TENCENT_VECTOR_DB_DATABASE:-dify}
  198. TENCENT_VECTOR_DB_SHARD: ${TENCENT_VECTOR_DB_SHARD:-1}
  199. TENCENT_VECTOR_DB_REPLICAS: ${TENCENT_VECTOR_DB_REPLICAS:-2}
  200. BAIDU_VECTOR_DB_ENDPOINT: ${BAIDU_VECTOR_DB_ENDPOINT:-http://127.0.0.1:5287}
  201. BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS: ${BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS:-30000}
  202. BAIDU_VECTOR_DB_ACCOUNT: ${BAIDU_VECTOR_DB_ACCOUNT:-root}
  203. BAIDU_VECTOR_DB_API_KEY: ${BAIDU_VECTOR_DB_API_KEY:-dify}
  204. BAIDU_VECTOR_DB_DATABASE: ${BAIDU_VECTOR_DB_DATABASE:-dify}
  205. BAIDU_VECTOR_DB_SHARD: ${BAIDU_VECTOR_DB_SHARD:-1}
  206. BAIDU_VECTOR_DB_REPLICAS: ${BAIDU_VECTOR_DB_REPLICAS:-3}
  207. VIKINGDB_ACCESS_KEY: ${VIKINGDB_ACCESS_KEY:-dify}
  208. VIKINGDB_SECRET_KEY: ${VIKINGDB_SECRET_KEY:-dify}
  209. VIKINGDB_REGION: ${VIKINGDB_REGION:-cn-shanghai}
  210. VIKINGDB_HOST: ${VIKINGDB_HOST:-api-vikingdb.xxx.volces.com}
  211. VIKINGDB_SCHEMA: ${VIKINGDB_SCHEMA:-http}
  212. UPSTASH_VECTOR_URL: ${UPSTASH_VECTOR_URL:-https://xxx-vector.upstash.io}
  213. UPSTASH_VECTOR_TOKEN: ${UPSTASH_VECTOR_TOKEN:-dify}
  214. UPLOAD_FILE_SIZE_LIMIT: ${UPLOAD_FILE_SIZE_LIMIT:-15}
  215. UPLOAD_FILE_BATCH_LIMIT: ${UPLOAD_FILE_BATCH_LIMIT:-5}
  216. ETL_TYPE: ${ETL_TYPE:-dify}
  217. UNSTRUCTURED_API_URL: ${UNSTRUCTURED_API_URL:-}
  218. PROMPT_GENERATION_MAX_TOKENS: ${PROMPT_GENERATION_MAX_TOKENS:-512}
  219. CODE_GENERATION_MAX_TOKENS: ${CODE_GENERATION_MAX_TOKENS:-1024}
  220. MULTIMODAL_SEND_IMAGE_FORMAT: ${MULTIMODAL_SEND_IMAGE_FORMAT:-base64}
  221. MULTIMODAL_SEND_VIDEO_FORMAT: ${MULTIMODAL_SEND_VIDEO_FORMAT:-base64}
  222. UPLOAD_IMAGE_FILE_SIZE_LIMIT: ${UPLOAD_IMAGE_FILE_SIZE_LIMIT:-10}
  223. UPLOAD_VIDEO_FILE_SIZE_LIMIT: ${UPLOAD_VIDEO_FILE_SIZE_LIMIT:-100}
  224. UPLOAD_AUDIO_FILE_SIZE_LIMIT: ${UPLOAD_AUDIO_FILE_SIZE_LIMIT:-50}
  225. SENTRY_DSN: ${API_SENTRY_DSN:-}
  226. SENTRY_TRACES_SAMPLE_RATE: ${API_SENTRY_TRACES_SAMPLE_RATE:-1.0}
  227. SENTRY_PROFILES_SAMPLE_RATE: ${API_SENTRY_PROFILES_SAMPLE_RATE:-1.0}
  228. NOTION_INTEGRATION_TYPE: ${NOTION_INTEGRATION_TYPE:-public}
  229. NOTION_CLIENT_SECRET: ${NOTION_CLIENT_SECRET:-}
  230. NOTION_CLIENT_ID: ${NOTION_CLIENT_ID:-}
  231. NOTION_INTERNAL_SECRET: ${NOTION_INTERNAL_SECRET:-}
  232. MAIL_TYPE: ${MAIL_TYPE:-resend}
  233. MAIL_DEFAULT_SEND_FROM: ${MAIL_DEFAULT_SEND_FROM:-}
  234. SMTP_SERVER: ${SMTP_SERVER:-}
  235. SMTP_PORT: ${SMTP_PORT:-465}
  236. SMTP_USERNAME: ${SMTP_USERNAME:-}
  237. SMTP_PASSWORD: ${SMTP_PASSWORD:-}
  238. SMTP_USE_TLS: ${SMTP_USE_TLS:-true}
  239. SMTP_OPPORTUNISTIC_TLS: ${SMTP_OPPORTUNISTIC_TLS:-false}
  240. RESEND_API_KEY: ${RESEND_API_KEY:-your-resend-api-key}
  241. RESEND_API_URL: ${RESEND_API_URL:-https://api.resend.com}
  242. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: ${INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH:-1000}
  243. INVITE_EXPIRY_HOURS: ${INVITE_EXPIRY_HOURS:-72}
  244. RESET_PASSWORD_TOKEN_EXPIRY_MINUTES: ${RESET_PASSWORD_TOKEN_EXPIRY_MINUTES:-5}
  245. CODE_EXECUTION_ENDPOINT: ${CODE_EXECUTION_ENDPOINT:-http://sandbox:8194}
  246. CODE_EXECUTION_API_KEY: ${SANDBOX_API_KEY:-dify-sandbox}
  247. CODE_MAX_NUMBER: ${CODE_MAX_NUMBER:-9223372036854775807}
  248. CODE_MIN_NUMBER: ${CODE_MIN_NUMBER:--9223372036854775808}
  249. CODE_MAX_DEPTH: ${CODE_MAX_DEPTH:-5}
  250. CODE_MAX_PRECISION: ${CODE_MAX_PRECISION:-20}
  251. CODE_MAX_STRING_LENGTH: ${CODE_MAX_STRING_LENGTH:-80000}
  252. TEMPLATE_TRANSFORM_MAX_LENGTH: ${TEMPLATE_TRANSFORM_MAX_LENGTH:-80000}
  253. CODE_MAX_STRING_ARRAY_LENGTH: ${CODE_MAX_STRING_ARRAY_LENGTH:-30}
  254. CODE_MAX_OBJECT_ARRAY_LENGTH: ${CODE_MAX_OBJECT_ARRAY_LENGTH:-30}
  255. CODE_MAX_NUMBER_ARRAY_LENGTH: ${CODE_MAX_NUMBER_ARRAY_LENGTH:-1000}
  256. WORKFLOW_MAX_EXECUTION_STEPS: ${WORKFLOW_MAX_EXECUTION_STEPS:-500}
  257. WORKFLOW_MAX_EXECUTION_TIME: ${WORKFLOW_MAX_EXECUTION_TIME:-1200}
  258. WORKFLOW_CALL_MAX_DEPTH: ${WORKFLOW_CALL_MAX_DEPTH:-5}
  259. SSRF_PROXY_HTTP_URL: ${SSRF_PROXY_HTTP_URL:-http://ssrf_proxy:3128}
  260. SSRF_PROXY_HTTPS_URL: ${SSRF_PROXY_HTTPS_URL:-http://ssrf_proxy:3128}
  261. HTTP_REQUEST_NODE_MAX_BINARY_SIZE: ${HTTP_REQUEST_NODE_MAX_BINARY_SIZE:-10485760}
  262. HTTP_REQUEST_NODE_MAX_TEXT_SIZE: ${HTTP_REQUEST_NODE_MAX_TEXT_SIZE:-1048576}
  263. APP_MAX_EXECUTION_TIME: ${APP_MAX_EXECUTION_TIME:-12000}
  264. POSITION_TOOL_PINS: ${POSITION_TOOL_PINS:-}
  265. POSITION_TOOL_INCLUDES: ${POSITION_TOOL_INCLUDES:-}
  266. POSITION_TOOL_EXCLUDES: ${POSITION_TOOL_EXCLUDES:-}
  267. POSITION_PROVIDER_PINS: ${POSITION_PROVIDER_PINS:-}
  268. POSITION_PROVIDER_INCLUDES: ${POSITION_PROVIDER_INCLUDES:-}
  269. POSITION_PROVIDER_EXCLUDES: ${POSITION_PROVIDER_EXCLUDES:-}
  270. MAX_VARIABLE_SIZE: ${MAX_VARIABLE_SIZE:-204800}
  271. OCEANBASE_VECTOR_HOST: ${OCEANBASE_VECTOR_HOST:-http://oceanbase-vector}
  272. OCEANBASE_VECTOR_PORT: ${OCEANBASE_VECTOR_PORT:-2881}
  273. OCEANBASE_VECTOR_USER: ${OCEANBASE_VECTOR_USER:-root@test}
  274. OCEANBASE_VECTOR_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-difyai123456}
  275. OCEANBASE_VECTOR_DATABASE: ${OCEANBASE_VECTOR_DATABASE:-test}
  276. OCEANBASE_CLUSTER_NAME: ${OCEANBASE_CLUSTER_NAME:-difyai}
  277. OCEANBASE_MEMORY_LIMIT: ${OCEANBASE_MEMORY_LIMIT:-6G}
  278. CREATE_TIDB_SERVICE_JOB_ENABLED: ${CREATE_TIDB_SERVICE_JOB_ENABLED:-false}
  279. services:
  280. # API service
  281. api:
  282. image: langgenius/dify-api:0.11.0
  283. restart: always
  284. environment:
  285. # Use the shared environment variables.
  286. <<: *shared-api-worker-env
  287. # Startup mode, 'api' starts the API server.
  288. MODE: api
  289. depends_on:
  290. - db
  291. - redis
  292. volumes:
  293. # Mount the storage directory to the container, for storing user files.
  294. - ./volumes/app/storage:/app/api/storage
  295. networks:
  296. - ssrf_proxy_network
  297. - default
  298. # worker service
  299. # The Celery worker for processing the queue.
  300. worker:
  301. image: langgenius/dify-api:0.11.0
  302. restart: always
  303. environment:
  304. # Use the shared environment variables.
  305. <<: *shared-api-worker-env
  306. # Startup mode, 'worker' starts the Celery worker for processing the queue.
  307. MODE: worker
  308. depends_on:
  309. - db
  310. - redis
  311. volumes:
  312. # Mount the storage directory to the container, for storing user files.
  313. - ./volumes/app/storage:/app/api/storage
  314. networks:
  315. - ssrf_proxy_network
  316. - default
  317. # Frontend web application.
  318. web:
  319. image: langgenius/dify-web:0.11.0
  320. restart: always
  321. environment:
  322. CONSOLE_API_URL: ${CONSOLE_API_URL:-}
  323. APP_API_URL: ${APP_API_URL:-}
  324. SENTRY_DSN: ${WEB_SENTRY_DSN:-}
  325. NEXT_TELEMETRY_DISABLED: ${NEXT_TELEMETRY_DISABLED:-0}
  326. TEXT_GENERATION_TIMEOUT_MS: ${TEXT_GENERATION_TIMEOUT_MS:-60000}
  327. CSP_WHITELIST: ${CSP_WHITELIST:-}
  328. # The postgres database.
  329. db:
  330. image: postgres:15-alpine
  331. restart: always
  332. environment:
  333. PGUSER: ${PGUSER:-postgres}
  334. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-difyai123456}
  335. POSTGRES_DB: ${POSTGRES_DB:-dify}
  336. PGDATA: ${PGDATA:-/var/lib/postgresql/data/pgdata}
  337. command: >
  338. postgres -c 'max_connections=${POSTGRES_MAX_CONNECTIONS:-100}'
  339. -c 'shared_buffers=${POSTGRES_SHARED_BUFFERS:-128MB}'
  340. -c 'work_mem=${POSTGRES_WORK_MEM:-4MB}'
  341. -c 'maintenance_work_mem=${POSTGRES_MAINTENANCE_WORK_MEM:-64MB}'
  342. -c 'effective_cache_size=${POSTGRES_EFFECTIVE_CACHE_SIZE:-4096MB}'
  343. volumes:
  344. - ./volumes/db/data:/var/lib/postgresql/data
  345. healthcheck:
  346. test: ['CMD', 'pg_isready']
  347. interval: 1s
  348. timeout: 3s
  349. retries: 30
  350. # The redis cache.
  351. redis:
  352. image: redis:6-alpine
  353. restart: always
  354. volumes:
  355. # Mount the redis data directory to the container.
  356. - ./volumes/redis/data:/data
  357. # Set the redis password when startup redis server.
  358. command: redis-server --requirepass ${REDIS_PASSWORD:-difyai123456}
  359. healthcheck:
  360. test: ['CMD', 'redis-cli', 'ping']
  361. # The DifySandbox
  362. sandbox:
  363. image: langgenius/dify-sandbox:0.2.10
  364. restart: always
  365. environment:
  366. # The DifySandbox configurations
  367. # Make sure you are changing this key for your deployment with a strong key.
  368. # You can generate a strong key using `openssl rand -base64 42`.
  369. API_KEY: ${SANDBOX_API_KEY:-dify-sandbox}
  370. GIN_MODE: ${SANDBOX_GIN_MODE:-release}
  371. WORKER_TIMEOUT: ${SANDBOX_WORKER_TIMEOUT:-15}
  372. ENABLE_NETWORK: ${SANDBOX_ENABLE_NETWORK:-true}
  373. HTTP_PROXY: ${SANDBOX_HTTP_PROXY:-http://ssrf_proxy:3128}
  374. HTTPS_PROXY: ${SANDBOX_HTTPS_PROXY:-http://ssrf_proxy:3128}
  375. SANDBOX_PORT: ${SANDBOX_PORT:-8194}
  376. volumes:
  377. - ./volumes/sandbox/dependencies:/dependencies
  378. healthcheck:
  379. test: ['CMD', 'curl', '-f', 'http://localhost:8194/health']
  380. networks:
  381. - ssrf_proxy_network
  382. # ssrf_proxy server
  383. # for more information, please refer to
  384. # https://docs.dify.ai/learn-more/faq/install-faq#id-18.-why-is-ssrf_proxy-needed
  385. ssrf_proxy:
  386. image: ubuntu/squid:latest
  387. restart: always
  388. volumes:
  389. - ./ssrf_proxy/squid.conf.template:/etc/squid/squid.conf.template
  390. - ./ssrf_proxy/docker-entrypoint.sh:/docker-entrypoint-mount.sh
  391. entrypoint:
  392. [
  393. 'sh',
  394. '-c',
  395. "cp /docker-entrypoint-mount.sh /docker-entrypoint.sh && sed -i 's/\r$$//' /docker-entrypoint.sh && chmod +x /docker-entrypoint.sh && /docker-entrypoint.sh",
  396. ]
  397. environment:
  398. # pls clearly modify the squid env vars to fit your network environment.
  399. HTTP_PORT: ${SSRF_HTTP_PORT:-3128}
  400. COREDUMP_DIR: ${SSRF_COREDUMP_DIR:-/var/spool/squid}
  401. REVERSE_PROXY_PORT: ${SSRF_REVERSE_PROXY_PORT:-8194}
  402. SANDBOX_HOST: ${SSRF_SANDBOX_HOST:-sandbox}
  403. SANDBOX_PORT: ${SANDBOX_PORT:-8194}
  404. networks:
  405. - ssrf_proxy_network
  406. - default
  407. # Certbot service
  408. # use `docker-compose --profile certbot up` to start the certbot service.
  409. certbot:
  410. image: certbot/certbot
  411. profiles:
  412. - certbot
  413. volumes:
  414. - ./volumes/certbot/conf:/etc/letsencrypt
  415. - ./volumes/certbot/www:/var/www/html
  416. - ./volumes/certbot/logs:/var/log/letsencrypt
  417. - ./volumes/certbot/conf/live:/etc/letsencrypt/live
  418. - ./certbot/update-cert.template.txt:/update-cert.template.txt
  419. - ./certbot/docker-entrypoint.sh:/docker-entrypoint.sh
  420. environment:
  421. - CERTBOT_EMAIL=${CERTBOT_EMAIL}
  422. - CERTBOT_DOMAIN=${CERTBOT_DOMAIN}
  423. - CERTBOT_OPTIONS=${CERTBOT_OPTIONS:-}
  424. entrypoint: ['/docker-entrypoint.sh']
  425. command: ['tail', '-f', '/dev/null']
  426. # The nginx reverse proxy.
  427. # used for reverse proxying the API service and Web service.
  428. nginx:
  429. image: nginx:latest
  430. restart: always
  431. volumes:
  432. - ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template
  433. - ./nginx/proxy.conf.template:/etc/nginx/proxy.conf.template
  434. - ./nginx/https.conf.template:/etc/nginx/https.conf.template
  435. - ./nginx/conf.d:/etc/nginx/conf.d
  436. - ./nginx/docker-entrypoint.sh:/docker-entrypoint-mount.sh
  437. - ./nginx/ssl:/etc/ssl # cert dir (legacy)
  438. - ./volumes/certbot/conf/live:/etc/letsencrypt/live # cert dir (with certbot container)
  439. - ./volumes/certbot/conf:/etc/letsencrypt
  440. - ./volumes/certbot/www:/var/www/html
  441. entrypoint:
  442. [
  443. 'sh',
  444. '-c',
  445. "cp /docker-entrypoint-mount.sh /docker-entrypoint.sh && sed -i 's/\r$$//' /docker-entrypoint.sh && chmod +x /docker-entrypoint.sh && /docker-entrypoint.sh",
  446. ]
  447. environment:
  448. NGINX_SERVER_NAME: ${NGINX_SERVER_NAME:-_}
  449. NGINX_HTTPS_ENABLED: ${NGINX_HTTPS_ENABLED:-false}
  450. NGINX_SSL_PORT: ${NGINX_SSL_PORT:-443}
  451. NGINX_PORT: ${NGINX_PORT:-80}
  452. # You're required to add your own SSL certificates/keys to the `./nginx/ssl` directory
  453. # and modify the env vars below in .env if HTTPS_ENABLED is true.
  454. NGINX_SSL_CERT_FILENAME: ${NGINX_SSL_CERT_FILENAME:-dify.crt}
  455. NGINX_SSL_CERT_KEY_FILENAME: ${NGINX_SSL_CERT_KEY_FILENAME:-dify.key}
  456. NGINX_SSL_PROTOCOLS: ${NGINX_SSL_PROTOCOLS:-TLSv1.1 TLSv1.2 TLSv1.3}
  457. NGINX_WORKER_PROCESSES: ${NGINX_WORKER_PROCESSES:-auto}
  458. NGINX_CLIENT_MAX_BODY_SIZE: ${NGINX_CLIENT_MAX_BODY_SIZE:-15M}
  459. NGINX_KEEPALIVE_TIMEOUT: ${NGINX_KEEPALIVE_TIMEOUT:-65}
  460. NGINX_PROXY_READ_TIMEOUT: ${NGINX_PROXY_READ_TIMEOUT:-3600s}
  461. NGINX_PROXY_SEND_TIMEOUT: ${NGINX_PROXY_SEND_TIMEOUT:-3600s}
  462. NGINX_ENABLE_CERTBOT_CHALLENGE: ${NGINX_ENABLE_CERTBOT_CHALLENGE:-false}
  463. CERTBOT_DOMAIN: ${CERTBOT_DOMAIN:-}
  464. depends_on:
  465. - api
  466. - web
  467. ports:
  468. - '${EXPOSE_NGINX_PORT:-80}:${NGINX_PORT:-80}'
  469. - '${EXPOSE_NGINX_SSL_PORT:-443}:${NGINX_SSL_PORT:-443}'
  470. # The Weaviate vector store.
  471. weaviate:
  472. image: semitechnologies/weaviate:1.19.0
  473. profiles:
  474. - ''
  475. - weaviate
  476. restart: always
  477. volumes:
  478. # Mount the Weaviate data directory to the con tainer.
  479. - ./volumes/weaviate:/var/lib/weaviate
  480. environment:
  481. # The Weaviate configurations
  482. # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.
  483. PERSISTENCE_DATA_PATH: ${WEAVIATE_PERSISTENCE_DATA_PATH:-/var/lib/weaviate}
  484. QUERY_DEFAULTS_LIMIT: ${WEAVIATE_QUERY_DEFAULTS_LIMIT:-25}
  485. AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: ${WEAVIATE_AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED:-false}
  486. DEFAULT_VECTORIZER_MODULE: ${WEAVIATE_DEFAULT_VECTORIZER_MODULE:-none}
  487. CLUSTER_HOSTNAME: ${WEAVIATE_CLUSTER_HOSTNAME:-node1}
  488. AUTHENTICATION_APIKEY_ENABLED: ${WEAVIATE_AUTHENTICATION_APIKEY_ENABLED:-true}
  489. AUTHENTICATION_APIKEY_ALLOWED_KEYS: ${WEAVIATE_AUTHENTICATION_APIKEY_ALLOWED_KEYS:-WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih}
  490. AUTHENTICATION_APIKEY_USERS: ${WEAVIATE_AUTHENTICATION_APIKEY_USERS:-hello@dify.ai}
  491. AUTHORIZATION_ADMINLIST_ENABLED: ${WEAVIATE_AUTHORIZATION_ADMINLIST_ENABLED:-true}
  492. AUTHORIZATION_ADMINLIST_USERS: ${WEAVIATE_AUTHORIZATION_ADMINLIST_USERS:-hello@dify.ai}
  493. # Qdrant vector store.
  494. # (if used, you need to set VECTOR_STORE to qdrant in the api & worker service.)
  495. qdrant:
  496. image: langgenius/qdrant:v1.7.3
  497. profiles:
  498. - qdrant
  499. restart: always
  500. volumes:
  501. - ./volumes/qdrant:/qdrant/storage
  502. environment:
  503. QDRANT_API_KEY: ${QDRANT_API_KEY:-difyai123456}
  504. # The Couchbase vector store.
  505. couchbase-server:
  506. build: ./couchbase-server
  507. profiles:
  508. - couchbase
  509. restart: always
  510. environment:
  511. - CLUSTER_NAME=dify_search
  512. - COUCHBASE_ADMINISTRATOR_USERNAME=${COUCHBASE_USER:-Administrator}
  513. - COUCHBASE_ADMINISTRATOR_PASSWORD=${COUCHBASE_PASSWORD:-password}
  514. - COUCHBASE_BUCKET=${COUCHBASE_BUCKET_NAME:-Embeddings}
  515. - COUCHBASE_BUCKET_RAMSIZE=512
  516. - COUCHBASE_RAM_SIZE=2048
  517. - COUCHBASE_EVENTING_RAM_SIZE=512
  518. - COUCHBASE_INDEX_RAM_SIZE=512
  519. - COUCHBASE_FTS_RAM_SIZE=1024
  520. hostname: couchbase-server
  521. container_name: couchbase-server
  522. working_dir: /opt/couchbase
  523. stdin_open: true
  524. tty: true
  525. entrypoint: [""]
  526. command: sh -c "/opt/couchbase/init/init-cbserver.sh"
  527. volumes:
  528. - ./volumes/couchbase/data:/opt/couchbase/var/lib/couchbase/data
  529. healthcheck:
  530. # ensure bucket was created before proceeding
  531. test: [ "CMD-SHELL", "curl -s -f -u Administrator:password http://localhost:8091/pools/default/buckets | grep -q '\\[{' || exit 1" ]
  532. interval: 10s
  533. retries: 10
  534. start_period: 30s
  535. timeout: 10s
  536. # The pgvector vector database.
  537. pgvector:
  538. image: pgvector/pgvector:pg16
  539. profiles:
  540. - pgvector
  541. restart: always
  542. environment:
  543. PGUSER: ${PGVECTOR_PGUSER:-postgres}
  544. # The password for the default postgres user.
  545. POSTGRES_PASSWORD: ${PGVECTOR_POSTGRES_PASSWORD:-difyai123456}
  546. # The name of the default postgres database.
  547. POSTGRES_DB: ${PGVECTOR_POSTGRES_DB:-dify}
  548. # postgres data directory
  549. PGDATA: ${PGVECTOR_PGDATA:-/var/lib/postgresql/data/pgdata}
  550. volumes:
  551. - ./volumes/pgvector/data:/var/lib/postgresql/data
  552. healthcheck:
  553. test: ['CMD', 'pg_isready']
  554. interval: 1s
  555. timeout: 3s
  556. retries: 30
  557. # pgvecto-rs vector store
  558. pgvecto-rs:
  559. image: tensorchord/pgvecto-rs:pg16-v0.3.0
  560. profiles:
  561. - pgvecto-rs
  562. restart: always
  563. environment:
  564. PGUSER: ${PGVECTOR_PGUSER:-postgres}
  565. # The password for the default postgres user.
  566. POSTGRES_PASSWORD: ${PGVECTOR_POSTGRES_PASSWORD:-difyai123456}
  567. # The name of the default postgres database.
  568. POSTGRES_DB: ${PGVECTOR_POSTGRES_DB:-dify}
  569. # postgres data directory
  570. PGDATA: ${PGVECTOR_PGDATA:-/var/lib/postgresql/data/pgdata}
  571. volumes:
  572. - ./volumes/pgvecto_rs/data:/var/lib/postgresql/data
  573. healthcheck:
  574. test: ['CMD', 'pg_isready']
  575. interval: 1s
  576. timeout: 3s
  577. retries: 30
  578. # Chroma vector database
  579. chroma:
  580. image: ghcr.io/chroma-core/chroma:0.5.1
  581. profiles:
  582. - chroma
  583. restart: always
  584. volumes:
  585. - ./volumes/chroma:/chroma/chroma
  586. environment:
  587. CHROMA_SERVER_AUTHN_CREDENTIALS: ${CHROMA_SERVER_AUTHN_CREDENTIALS:-difyai123456}
  588. CHROMA_SERVER_AUTHN_PROVIDER: ${CHROMA_SERVER_AUTHN_PROVIDER:-chromadb.auth.token_authn.TokenAuthenticationServerProvider}
  589. IS_PERSISTENT: ${CHROMA_IS_PERSISTENT:-TRUE}
  590. # OceanBase vector database
  591. oceanbase:
  592. image: quay.io/oceanbase/oceanbase-ce:4.3.3.0-100000142024101215
  593. profiles:
  594. - oceanbase
  595. restart: always
  596. volumes:
  597. - ./volumes/oceanbase/data:/root/ob
  598. - ./volumes/oceanbase/conf:/root/.obd/cluster
  599. - ./volumes/oceanbase/init.d:/root/boot/init.d
  600. environment:
  601. OB_MEMORY_LIMIT: ${OCEANBASE_MEMORY_LIMIT:-6G}
  602. OB_SYS_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-difyai123456}
  603. OB_TENANT_PASSWORD: ${OCEANBASE_VECTOR_PASSWORD:-difyai123456}
  604. OB_CLUSTER_NAME: ${OCEANBASE_CLUSTER_NAME:-difyai}
  605. OB_SERVER_IP: '127.0.0.1'
  606. # Oracle vector database
  607. oracle:
  608. image: container-registry.oracle.com/database/free:latest
  609. profiles:
  610. - oracle
  611. restart: always
  612. volumes:
  613. - source: oradata
  614. type: volume
  615. target: /opt/oracle/oradata
  616. - ./startupscripts:/opt/oracle/scripts/startup
  617. environment:
  618. ORACLE_PWD: ${ORACLE_PWD:-Dify123456}
  619. ORACLE_CHARACTERSET: ${ORACLE_CHARACTERSET:-AL32UTF8}
  620. # Milvus vector database services
  621. etcd:
  622. container_name: milvus-etcd
  623. image: quay.io/coreos/etcd:v3.5.5
  624. profiles:
  625. - milvus
  626. environment:
  627. ETCD_AUTO_COMPACTION_MODE: ${ETCD_AUTO_COMPACTION_MODE:-revision}
  628. ETCD_AUTO_COMPACTION_RETENTION: ${ETCD_AUTO_COMPACTION_RETENTION:-1000}
  629. ETCD_QUOTA_BACKEND_BYTES: ${ETCD_QUOTA_BACKEND_BYTES:-4294967296}
  630. ETCD_SNAPSHOT_COUNT: ${ETCD_SNAPSHOT_COUNT:-50000}
  631. volumes:
  632. - ./volumes/milvus/etcd:/etcd
  633. command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
  634. healthcheck:
  635. test: ['CMD', 'etcdctl', 'endpoint', 'health']
  636. interval: 30s
  637. timeout: 20s
  638. retries: 3
  639. networks:
  640. - milvus
  641. minio:
  642. container_name: milvus-minio
  643. image: minio/minio:RELEASE.2023-03-20T20-16-18Z
  644. profiles:
  645. - milvus
  646. environment:
  647. MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin}
  648. MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin}
  649. volumes:
  650. - ./volumes/milvus/minio:/minio_data
  651. command: minio server /minio_data --console-address ":9001"
  652. healthcheck:
  653. test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
  654. interval: 30s
  655. timeout: 20s
  656. retries: 3
  657. networks:
  658. - milvus
  659. milvus-standalone:
  660. container_name: milvus-standalone
  661. image: milvusdb/milvus:v2.3.1
  662. profiles:
  663. - milvus
  664. command: ['milvus', 'run', 'standalone']
  665. environment:
  666. ETCD_ENDPOINTS: ${ETCD_ENDPOINTS:-etcd:2379}
  667. MINIO_ADDRESS: ${MINIO_ADDRESS:-minio:9000}
  668. common.security.authorizationEnabled: ${MILVUS_AUTHORIZATION_ENABLED:-true}
  669. volumes:
  670. - ./volumes/milvus/milvus:/var/lib/milvus
  671. healthcheck:
  672. test: ['CMD', 'curl', '-f', 'http://localhost:9091/healthz']
  673. interval: 30s
  674. start_period: 90s
  675. timeout: 20s
  676. retries: 3
  677. depends_on:
  678. - etcd
  679. - minio
  680. ports:
  681. - 19530:19530
  682. - 9091:9091
  683. networks:
  684. - milvus
  685. # Opensearch vector database
  686. opensearch:
  687. container_name: opensearch
  688. image: opensearchproject/opensearch:latest
  689. profiles:
  690. - opensearch
  691. environment:
  692. discovery.type: ${OPENSEARCH_DISCOVERY_TYPE:-single-node}
  693. bootstrap.memory_lock: ${OPENSEARCH_BOOTSTRAP_MEMORY_LOCK:-true}
  694. OPENSEARCH_JAVA_OPTS: -Xms${OPENSEARCH_JAVA_OPTS_MIN:-512m} -Xmx${OPENSEARCH_JAVA_OPTS_MAX:-1024m}
  695. OPENSEARCH_INITIAL_ADMIN_PASSWORD: ${OPENSEARCH_INITIAL_ADMIN_PASSWORD:-Qazwsxedc!@#123}
  696. ulimits:
  697. memlock:
  698. soft: ${OPENSEARCH_MEMLOCK_SOFT:--1}
  699. hard: ${OPENSEARCH_MEMLOCK_HARD:--1}
  700. nofile:
  701. soft: ${OPENSEARCH_NOFILE_SOFT:-65536}
  702. hard: ${OPENSEARCH_NOFILE_HARD:-65536}
  703. volumes:
  704. - ./volumes/opensearch/data:/usr/share/opensearch/data
  705. networks:
  706. - opensearch-net
  707. opensearch-dashboards:
  708. container_name: opensearch-dashboards
  709. image: opensearchproject/opensearch-dashboards:latest
  710. profiles:
  711. - opensearch
  712. environment:
  713. OPENSEARCH_HOSTS: '["https://opensearch:9200"]'
  714. volumes:
  715. - ./volumes/opensearch/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
  716. networks:
  717. - opensearch-net
  718. depends_on:
  719. - opensearch
  720. # MyScale vector database
  721. myscale:
  722. container_name: myscale
  723. image: myscale/myscaledb:1.6.4
  724. profiles:
  725. - myscale
  726. restart: always
  727. tty: true
  728. volumes:
  729. - ./volumes/myscale/data:/var/lib/clickhouse
  730. - ./volumes/myscale/log:/var/log/clickhouse-server
  731. - ./volumes/myscale/config/users.d/custom_users_config.xml:/etc/clickhouse-server/users.d/custom_users_config.xml
  732. ports:
  733. - ${MYSCALE_PORT:-8123}:${MYSCALE_PORT:-8123}
  734. # https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html
  735. # https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-prerequisites
  736. elasticsearch:
  737. image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3
  738. container_name: elasticsearch
  739. profiles:
  740. - elasticsearch
  741. restart: always
  742. volumes:
  743. - dify_es01_data:/usr/share/elasticsearch/data
  744. environment:
  745. ELASTIC_PASSWORD: ${ELASTICSEARCH_PASSWORD:-elastic}
  746. cluster.name: dify-es-cluster
  747. node.name: dify-es0
  748. discovery.type: single-node
  749. xpack.license.self_generated.type: trial
  750. xpack.security.enabled: 'true'
  751. xpack.security.enrollment.enabled: 'false'
  752. xpack.security.http.ssl.enabled: 'false'
  753. ports:
  754. - ${ELASTICSEARCH_PORT:-9200}:9200
  755. healthcheck:
  756. test: ['CMD', 'curl', '-s', 'http://localhost:9200/_cluster/health?pretty']
  757. interval: 30s
  758. timeout: 10s
  759. retries: 50
  760. # https://www.elastic.co/guide/en/kibana/current/docker.html
  761. # https://www.elastic.co/guide/en/kibana/current/settings.html
  762. kibana:
  763. image: docker.elastic.co/kibana/kibana:8.14.3
  764. container_name: kibana
  765. profiles:
  766. - elasticsearch
  767. depends_on:
  768. - elasticsearch
  769. restart: always
  770. environment:
  771. XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa
  772. NO_PROXY: localhost,127.0.0.1,elasticsearch,kibana
  773. XPACK_SECURITY_ENABLED: 'true'
  774. XPACK_SECURITY_ENROLLMENT_ENABLED: 'false'
  775. XPACK_SECURITY_HTTP_SSL_ENABLED: 'false'
  776. XPACK_FLEET_ISAIRGAPPED: 'true'
  777. I18N_LOCALE: zh-CN
  778. SERVER_PORT: '5601'
  779. ELASTICSEARCH_HOSTS: http://elasticsearch:9200
  780. ports:
  781. - ${KIBANA_PORT:-5601}:5601
  782. healthcheck:
  783. test: ['CMD-SHELL', 'curl -s http://localhost:5601 >/dev/null || exit 1']
  784. interval: 30s
  785. timeout: 10s
  786. retries: 3
  787. # unstructured .
  788. # (if used, you need to set ETL_TYPE to Unstructured in the api & worker service.)
  789. unstructured:
  790. image: downloads.unstructured.io/unstructured-io/unstructured-api:latest
  791. profiles:
  792. - unstructured
  793. restart: always
  794. volumes:
  795. - ./volumes/unstructured:/app/data
  796. networks:
  797. # create a network between sandbox, api and ssrf_proxy, and can not access outside.
  798. ssrf_proxy_network:
  799. driver: bridge
  800. internal: true
  801. milvus:
  802. driver: bridge
  803. opensearch-net:
  804. driver: bridge
  805. internal: true
  806. volumes:
  807. oradata:
  808. dify_es01_data: