docker-compose.yaml 32 KB

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