.env.example 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. # ------------------------------
  2. # Environment Variables for API service & worker
  3. # ------------------------------
  4. # ------------------------------
  5. # Common Variables
  6. # ------------------------------
  7. # The backend URL of the console API,
  8. # used to concatenate the authorization callback.
  9. # If empty, it is the same domain.
  10. # Example: https://api.console.dify.ai
  11. CONSOLE_API_URL=
  12. # The front-end URL of the console web,
  13. # used to concatenate some front-end addresses and for CORS configuration use.
  14. # If empty, it is the same domain.
  15. # Example: https://console.dify.ai
  16. CONSOLE_WEB_URL=
  17. # Service API Url,
  18. # used to display Service API Base Url to the front-end.
  19. # If empty, it is the same domain.
  20. # Example: https://api.dify.ai
  21. SERVICE_API_URL=
  22. # WebApp API backend Url,
  23. # used to declare the back-end URL for the front-end API.
  24. # If empty, it is the same domain.
  25. # Example: https://api.app.dify.ai
  26. APP_API_URL=
  27. # WebApp Url,
  28. # used to display WebAPP API Base Url to the front-end.
  29. # If empty, it is the same domain.
  30. # Example: https://app.dify.ai
  31. APP_WEB_URL=
  32. # File preview or download Url prefix.
  33. # used to display File preview or download Url to the front-end or as Multi-model inputs;
  34. # Url is signed and has expiration time.
  35. FILES_URL=
  36. # ------------------------------
  37. # Server Configuration
  38. # ------------------------------
  39. # The log level for the application.
  40. # Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
  41. LOG_LEVEL=INFO
  42. # Log file path
  43. LOG_FILE=/app/logs/server.log
  44. # Log file max size, the unit is MB
  45. LOG_FILE_MAX_SIZE=20
  46. # Log file max backup count
  47. LOG_FILE_BACKUP_COUNT=5
  48. # Log dateformat
  49. LOG_DATEFORMAT=%Y-%m-%d %H:%M:%S
  50. # Log Timezone
  51. LOG_TZ=UTC
  52. # Debug mode, default is false.
  53. # It is recommended to turn on this configuration for local development
  54. # to prevent some problems caused by monkey patch.
  55. DEBUG=false
  56. # Flask debug mode, it can output trace information at the interface when turned on,
  57. # which is convenient for debugging.
  58. FLASK_DEBUG=false
  59. # A secretkey that is used for securely signing the session cookie
  60. # and encrypting sensitive information on the database.
  61. # You can generate a strong key using `openssl rand -base64 42`.
  62. SECRET_KEY=sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
  63. # Password for admin user initialization.
  64. # If left unset, admin user will not be prompted for a password
  65. # when creating the initial admin account.
  66. # The length of the password cannot exceed 30 charactors.
  67. INIT_PASSWORD=
  68. # Deployment environment.
  69. # Supported values are `PRODUCTION`, `TESTING`. Default is `PRODUCTION`.
  70. # Testing environment. There will be a distinct color label on the front-end page,
  71. # indicating that this environment is a testing environment.
  72. DEPLOY_ENV=PRODUCTION
  73. # Whether to enable the version check policy.
  74. # If set to empty, https://updates.dify.ai will be called for version check.
  75. CHECK_UPDATE_URL=https://updates.dify.ai
  76. # Used to change the OpenAI base address, default is https://api.openai.com/v1.
  77. # When OpenAI cannot be accessed in China, replace it with a domestic mirror address,
  78. # or when a local model provides OpenAI compatible API, it can be replaced.
  79. OPENAI_API_BASE=https://api.openai.com/v1
  80. # When enabled, migrations will be executed prior to application startup
  81. # and the application will start after the migrations have completed.
  82. MIGRATION_ENABLED=true
  83. # File Access Time specifies a time interval in seconds for the file to be accessed.
  84. # The default value is 300 seconds.
  85. FILES_ACCESS_TIMEOUT=300
  86. # Access token expiration time in minutes
  87. ACCESS_TOKEN_EXPIRE_MINUTES=60
  88. # The maximum number of active requests for the application, where 0 means unlimited, should be a non-negative integer.
  89. APP_MAX_ACTIVE_REQUESTS=0
  90. # ------------------------------
  91. # Container Startup Related Configuration
  92. # Only effective when starting with docker image or docker-compose.
  93. # ------------------------------
  94. # API service binding address, default: 0.0.0.0, i.e., all addresses can be accessed.
  95. DIFY_BIND_ADDRESS=0.0.0.0
  96. # API service binding port number, default 5001.
  97. DIFY_PORT=5001
  98. # The number of API server workers, i.e., the number of gevent workers.
  99. # Formula: number of cpu cores x 2 + 1
  100. # Reference: https://docs.gunicorn.org/en/stable/design.html#how-many-workers
  101. SERVER_WORKER_AMOUNT=
  102. # Defaults to gevent. If using windows, it can be switched to sync or solo.
  103. SERVER_WORKER_CLASS=
  104. # Similar to SERVER_WORKER_CLASS. Default is gevent.
  105. # If using windows, it can be switched to sync or solo.
  106. CELERY_WORKER_CLASS=
  107. # Request handling timeout. The default is 200,
  108. # it is recommended to set it to 360 to support a longer sse connection time.
  109. GUNICORN_TIMEOUT=360
  110. # The number of Celery workers. The default is 1, and can be set as needed.
  111. CELERY_WORKER_AMOUNT=
  112. # Flag indicating whether to enable autoscaling of Celery workers.
  113. #
  114. # Autoscaling is useful when tasks are CPU intensive and can be dynamically
  115. # allocated and deallocated based on the workload.
  116. #
  117. # When autoscaling is enabled, the maximum and minimum number of workers can
  118. # be specified. The autoscaling algorithm will dynamically adjust the number
  119. # of workers within the specified range.
  120. #
  121. # Default is false (i.e., autoscaling is disabled).
  122. #
  123. # Example:
  124. # CELERY_AUTO_SCALE=true
  125. CELERY_AUTO_SCALE=false
  126. # The maximum number of Celery workers that can be autoscaled.
  127. # This is optional and only used when autoscaling is enabled.
  128. # Default is not set.
  129. CELERY_MAX_WORKERS=
  130. # The minimum number of Celery workers that can be autoscaled.
  131. # This is optional and only used when autoscaling is enabled.
  132. # Default is not set.
  133. CELERY_MIN_WORKERS=
  134. # API Tool configuration
  135. API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
  136. API_TOOL_DEFAULT_READ_TIMEOUT=60
  137. # ------------------------------
  138. # Database Configuration
  139. # The database uses PostgreSQL. Please use the public schema.
  140. # It is consistent with the configuration in the 'db' service below.
  141. # ------------------------------
  142. DB_USERNAME=postgres
  143. DB_PASSWORD=difyai123456
  144. DB_HOST=db
  145. DB_PORT=5432
  146. DB_DATABASE=dify
  147. # The size of the database connection pool.
  148. # The default is 30 connections, which can be appropriately increased.
  149. SQLALCHEMY_POOL_SIZE=30
  150. # Database connection pool recycling time, the default is 3600 seconds.
  151. SQLALCHEMY_POOL_RECYCLE=3600
  152. # Whether to print SQL, default is false.
  153. SQLALCHEMY_ECHO=false
  154. # Maximum number of connections to the database
  155. # Default is 100
  156. #
  157. # Reference: https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS
  158. POSTGRES_MAX_CONNECTIONS=100
  159. # Sets the amount of shared memory used for postgres's shared buffers.
  160. # Default is 128MB
  161. # Recommended value: 25% of available memory
  162. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-SHARED-BUFFERS
  163. POSTGRES_SHARED_BUFFERS=128MB
  164. # Sets the amount of memory used by each database worker for working space.
  165. # Default is 4MB
  166. #
  167. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-WORK-MEM
  168. POSTGRES_WORK_MEM=4MB
  169. # Sets the amount of memory reserved for maintenance activities.
  170. # Default is 64MB
  171. #
  172. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM
  173. POSTGRES_MAINTENANCE_WORK_MEM=64MB
  174. # Sets the planner's assumption about the effective cache size.
  175. # Default is 4096MB
  176. #
  177. # Reference: https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE
  178. POSTGRES_EFFECTIVE_CACHE_SIZE=4096MB
  179. # ------------------------------
  180. # Redis Configuration
  181. # This Redis configuration is used for caching and for pub/sub during conversation.
  182. # ------------------------------
  183. REDIS_HOST=redis
  184. REDIS_PORT=6379
  185. REDIS_USERNAME=
  186. REDIS_PASSWORD=difyai123456
  187. REDIS_USE_SSL=false
  188. # Whether to use Redis Sentinel mode.
  189. # If set to true, the application will automatically discover and connect to the master node through Sentinel.
  190. REDIS_USE_SENTINEL=false
  191. # List of Redis Sentinel nodes. If Sentinel mode is enabled, provide at least one Sentinel IP and port.
  192. # Format: `<sentinel1_ip>:<sentinel1_port>,<sentinel2_ip>:<sentinel2_port>,<sentinel3_ip>:<sentinel3_port>`
  193. REDIS_SENTINELS=
  194. REDIS_SENTINEL_SERVICE_NAME=
  195. REDIS_SENTINEL_USERNAME=
  196. REDIS_SENTINEL_PASSWORD=
  197. REDIS_SENTINEL_SOCKET_TIMEOUT=0.1
  198. # List of Redis Cluster nodes. If Cluster mode is enabled, provide at least one Cluster IP and port.
  199. # Format: `<Cluster1_ip>:<Cluster1_port>,<Cluster2_ip>:<Cluster2_port>,<Cluster3_ip>:<Cluster3_port>`
  200. REDIS_USE_CLUSTERS=false
  201. REDIS_CLUSTERS=
  202. REDIS_CLUSTERS_PASSWORD=
  203. # ------------------------------
  204. # Celery Configuration
  205. # ------------------------------
  206. # Use redis as the broker, and redis db 1 for celery broker.
  207. # Format as follows: `redis://<redis_username>:<redis_password>@<redis_host>:<redis_port>/<redis_database>`
  208. # Example: redis://:difyai123456@redis:6379/1
  209. # If use Redis Sentinel, format as follows: `sentinel://<sentinel_username>:<sentinel_password>@<sentinel_host>:<sentinel_port>/<redis_database>`
  210. # Example: sentinel://localhost:26379/1;sentinel://localhost:26380/1;sentinel://localhost:26381/1
  211. CELERY_BROKER_URL=redis://:difyai123456@redis:6379/1
  212. BROKER_USE_SSL=false
  213. # If you are using Redis Sentinel for high availability, configure the following settings.
  214. CELERY_USE_SENTINEL=false
  215. CELERY_SENTINEL_MASTER_NAME=
  216. CELERY_SENTINEL_SOCKET_TIMEOUT=0.1
  217. # ------------------------------
  218. # CORS Configuration
  219. # Used to set the front-end cross-domain access policy.
  220. # ------------------------------
  221. # Specifies the allowed origins for cross-origin requests to the Web API,
  222. # e.g. https://dify.app or * for all origins.
  223. WEB_API_CORS_ALLOW_ORIGINS=*
  224. # Specifies the allowed origins for cross-origin requests to the console API,
  225. # e.g. https://cloud.dify.ai or * for all origins.
  226. CONSOLE_CORS_ALLOW_ORIGINS=*
  227. # ------------------------------
  228. # File Storage Configuration
  229. # ------------------------------
  230. # The type of storage to use for storing user files.
  231. # Supported values are `opendal` , `s3` , `azure-blob` , `google-storage`, `tencent-cos`, `huawei-obs`, `volcengine-tos`, `baidu-obs`, `supabase`
  232. # Default: `opendal`
  233. STORAGE_TYPE=opendal
  234. # Apache OpenDAL Configuration, refer to https://github.com/apache/opendal
  235. # The scheme for the OpenDAL storage.
  236. STORAGE_OPENDAL_SCHEME=fs
  237. # OpenDAL FS
  238. OPENDAL_FS_ROOT=storage
  239. # OpenDAL S3
  240. OPENDAL_S3_ROOT=/
  241. OPENDAL_S3_BUCKET=your-bucket-name
  242. OPENDAL_S3_ENDPOINT=https://s3.amazonaws.com
  243. OPENDAL_S3_ACCESS_KEY_ID=your-access-key
  244. OPENDAL_S3_SECRET_ACCESS_KEY=your-secret-key
  245. OPENDAL_S3_REGION=your-region
  246. OPENDAL_S3_SERVER_SIDE_ENCRYPTION=
  247. # S3 Configuration
  248. # Whether to use AWS managed IAM roles for authenticating with the S3 service.
  249. # If set to false, the access key and secret key must be provided.
  250. S3_USE_AWS_MANAGED_IAM=false
  251. # The endpoint of the S3 service.
  252. S3_ENDPOINT=
  253. # The region of the S3 service.
  254. S3_REGION=us-east-1
  255. # The name of the S3 bucket to use for storing files.
  256. S3_BUCKET_NAME=difyai
  257. # The access key to use for authenticating with the S3 service.
  258. S3_ACCESS_KEY=
  259. # The secret key to use for authenticating with the S3 service.
  260. S3_SECRET_KEY=
  261. # Azure Blob Configuration
  262. # The name of the Azure Blob Storage account to use for storing files.
  263. AZURE_BLOB_ACCOUNT_NAME=difyai
  264. # The access key to use for authenticating with the Azure Blob Storage account.
  265. AZURE_BLOB_ACCOUNT_KEY=difyai
  266. # The name of the Azure Blob Storage container to use for storing files.
  267. AZURE_BLOB_CONTAINER_NAME=difyai-container
  268. # The URL of the Azure Blob Storage account.
  269. AZURE_BLOB_ACCOUNT_URL=https://<your_account_name>.blob.core.windows.net
  270. # Google Storage Configuration
  271. # The name of the Google Storage bucket to use for storing files.
  272. GOOGLE_STORAGE_BUCKET_NAME=your-bucket-name
  273. # The service account JSON key to use for authenticating with the Google Storage service.
  274. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64=your-google-service-account-json-base64-string
  275. # The Alibaba Cloud OSS configurations,
  276. # only available when STORAGE_TYPE is `aliyun-oss`
  277. ALIYUN_OSS_BUCKET_NAME=your-bucket-name
  278. ALIYUN_OSS_ACCESS_KEY=your-access-key
  279. ALIYUN_OSS_SECRET_KEY=your-secret-key
  280. ALIYUN_OSS_ENDPOINT=https://oss-ap-southeast-1-internal.aliyuncs.com
  281. ALIYUN_OSS_REGION=ap-southeast-1
  282. ALIYUN_OSS_AUTH_VERSION=v4
  283. # Don't start with '/'. OSS doesn't support leading slash in object names.
  284. ALIYUN_OSS_PATH=your-path
  285. # Tencent COS Configuration
  286. # The name of the Tencent COS bucket to use for storing files.
  287. TENCENT_COS_BUCKET_NAME=your-bucket-name
  288. # The secret key to use for authenticating with the Tencent COS service.
  289. TENCENT_COS_SECRET_KEY=your-secret-key
  290. # The secret id to use for authenticating with the Tencent COS service.
  291. TENCENT_COS_SECRET_ID=your-secret-id
  292. # The region of the Tencent COS service.
  293. TENCENT_COS_REGION=your-region
  294. # The scheme of the Tencent COS service.
  295. TENCENT_COS_SCHEME=your-scheme
  296. # Huawei OBS Configuration
  297. # The name of the Huawei OBS bucket to use for storing files.
  298. HUAWEI_OBS_BUCKET_NAME=your-bucket-name
  299. # The secret key to use for authenticating with the Huawei OBS service.
  300. HUAWEI_OBS_SECRET_KEY=your-secret-key
  301. # The access key to use for authenticating with the Huawei OBS service.
  302. HUAWEI_OBS_ACCESS_KEY=your-access-key
  303. # The server url of the HUAWEI OBS service.
  304. HUAWEI_OBS_SERVER=your-server-url
  305. # Volcengine TOS Configuration
  306. # The name of the Volcengine TOS bucket to use for storing files.
  307. VOLCENGINE_TOS_BUCKET_NAME=your-bucket-name
  308. # The secret key to use for authenticating with the Volcengine TOS service.
  309. VOLCENGINE_TOS_SECRET_KEY=your-secret-key
  310. # The access key to use for authenticating with the Volcengine TOS service.
  311. VOLCENGINE_TOS_ACCESS_KEY=your-access-key
  312. # The endpoint of the Volcengine TOS service.
  313. VOLCENGINE_TOS_ENDPOINT=your-server-url
  314. # The region of the Volcengine TOS service.
  315. VOLCENGINE_TOS_REGION=your-region
  316. # Baidu OBS Storage Configuration
  317. # The name of the Baidu OBS bucket to use for storing files.
  318. BAIDU_OBS_BUCKET_NAME=your-bucket-name
  319. # The secret key to use for authenticating with the Baidu OBS service.
  320. BAIDU_OBS_SECRET_KEY=your-secret-key
  321. # The access key to use for authenticating with the Baidu OBS service.
  322. BAIDU_OBS_ACCESS_KEY=your-access-key
  323. # The endpoint of the Baidu OBS service.
  324. BAIDU_OBS_ENDPOINT=your-server-url
  325. # Supabase Storage Configuration
  326. # The name of the Supabase bucket to use for storing files.
  327. SUPABASE_BUCKET_NAME=your-bucket-name
  328. # The api key to use for authenticating with the Supabase service.
  329. SUPABASE_API_KEY=your-access-key
  330. # The project endpoint url of the Supabase service.
  331. SUPABASE_URL=your-server-url
  332. # ------------------------------
  333. # Vector Database Configuration
  334. # ------------------------------
  335. # The type of vector store to use.
  336. # Supported values are `weaviate`, `qdrant`, `milvus`, `myscale`, `relyt`, `pgvector`, `pgvecto-rs`, `chroma`, `opensearch`, `tidb_vector`, `oracle`, `tencent`, `elasticsearch`, `analyticdb`, `couchbase`, `vikingdb`, `oceanbase`.
  337. VECTOR_STORE=weaviate
  338. # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
  339. WEAVIATE_ENDPOINT=http://weaviate:8080
  340. # The Weaviate API key.
  341. WEAVIATE_API_KEY=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  342. # The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
  343. QDRANT_URL=http://qdrant:6333
  344. # The Qdrant API key.
  345. QDRANT_API_KEY=difyai123456
  346. # The Qdrant client timeout setting.
  347. QDRANT_CLIENT_TIMEOUT=20
  348. # The Qdrant client enable gRPC mode.
  349. QDRANT_GRPC_ENABLED=false
  350. # The Qdrant server gRPC mode PORT.
  351. QDRANT_GRPC_PORT=6334
  352. # Milvus configuration Only available when VECTOR_STORE is `milvus`.
  353. # The milvus uri.
  354. MILVUS_URI=http://127.0.0.1:19530
  355. # The milvus token.
  356. MILVUS_TOKEN=
  357. # The milvus username.
  358. MILVUS_USER=root
  359. # The milvus password.
  360. MILVUS_PASSWORD=Milvus
  361. # MyScale configuration, only available when VECTOR_STORE is `myscale`
  362. # For multi-language support, please set MYSCALE_FTS_PARAMS with referring to:
  363. # https://myscale.com/docs/en/text-search/#understanding-fts-index-parameters
  364. MYSCALE_HOST=myscale
  365. MYSCALE_PORT=8123
  366. MYSCALE_USER=default
  367. MYSCALE_PASSWORD=
  368. MYSCALE_DATABASE=dify
  369. MYSCALE_FTS_PARAMS=
  370. # Couchbase configurations, only available when VECTOR_STORE is `couchbase`
  371. # The connection string must include hostname defined in the docker-compose file (couchbase-server in this case)
  372. COUCHBASE_CONNECTION_STRING=couchbase://couchbase-server
  373. COUCHBASE_USER=Administrator
  374. COUCHBASE_PASSWORD=password
  375. COUCHBASE_BUCKET_NAME=Embeddings
  376. COUCHBASE_SCOPE_NAME=_default
  377. # pgvector configurations, only available when VECTOR_STORE is `pgvector`
  378. PGVECTOR_HOST=pgvector
  379. PGVECTOR_PORT=5432
  380. PGVECTOR_USER=postgres
  381. PGVECTOR_PASSWORD=difyai123456
  382. PGVECTOR_DATABASE=dify
  383. PGVECTOR_MIN_CONNECTION=1
  384. PGVECTOR_MAX_CONNECTION=5
  385. # pgvecto-rs configurations, only available when VECTOR_STORE is `pgvecto-rs`
  386. PGVECTO_RS_HOST=pgvecto-rs
  387. PGVECTO_RS_PORT=5432
  388. PGVECTO_RS_USER=postgres
  389. PGVECTO_RS_PASSWORD=difyai123456
  390. PGVECTO_RS_DATABASE=dify
  391. # analyticdb configurations, only available when VECTOR_STORE is `analyticdb`
  392. ANALYTICDB_KEY_ID=your-ak
  393. ANALYTICDB_KEY_SECRET=your-sk
  394. ANALYTICDB_REGION_ID=cn-hangzhou
  395. ANALYTICDB_INSTANCE_ID=gp-ab123456
  396. ANALYTICDB_ACCOUNT=testaccount
  397. ANALYTICDB_PASSWORD=testpassword
  398. ANALYTICDB_NAMESPACE=dify
  399. ANALYTICDB_NAMESPACE_PASSWORD=difypassword
  400. ANALYTICDB_HOST=gp-test.aliyuncs.com
  401. ANALYTICDB_PORT=5432
  402. ANALYTICDB_MIN_CONNECTION=1
  403. ANALYTICDB_MAX_CONNECTION=5
  404. # TiDB vector configurations, only available when VECTOR_STORE is `tidb`
  405. TIDB_VECTOR_HOST=tidb
  406. TIDB_VECTOR_PORT=4000
  407. TIDB_VECTOR_USER=xxx.root
  408. TIDB_VECTOR_PASSWORD=xxxxxx
  409. TIDB_VECTOR_DATABASE=dify
  410. # Tidb on qdrant configuration, only available when VECTOR_STORE is `tidb_on_qdrant`
  411. TIDB_ON_QDRANT_URL=http://127.0.0.1
  412. TIDB_ON_QDRANT_API_KEY=dify
  413. TIDB_ON_QDRANT_CLIENT_TIMEOUT=20
  414. TIDB_ON_QDRANT_GRPC_ENABLED=false
  415. TIDB_ON_QDRANT_GRPC_PORT=6334
  416. TIDB_PUBLIC_KEY=dify
  417. TIDB_PRIVATE_KEY=dify
  418. TIDB_API_URL=http://127.0.0.1
  419. TIDB_IAM_API_URL=http://127.0.0.1
  420. TIDB_REGION=regions/aws-us-east-1
  421. TIDB_PROJECT_ID=dify
  422. TIDB_SPEND_LIMIT=100
  423. # Chroma configuration, only available when VECTOR_STORE is `chroma`
  424. CHROMA_HOST=127.0.0.1
  425. CHROMA_PORT=8000
  426. CHROMA_TENANT=default_tenant
  427. CHROMA_DATABASE=default_database
  428. CHROMA_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthClientProvider
  429. CHROMA_AUTH_CREDENTIALS=xxxxxx
  430. # Oracle configuration, only available when VECTOR_STORE is `oracle`
  431. ORACLE_HOST=oracle
  432. ORACLE_PORT=1521
  433. ORACLE_USER=dify
  434. ORACLE_PASSWORD=dify
  435. ORACLE_DATABASE=FREEPDB1
  436. # relyt configurations, only available when VECTOR_STORE is `relyt`
  437. RELYT_HOST=db
  438. RELYT_PORT=5432
  439. RELYT_USER=postgres
  440. RELYT_PASSWORD=difyai123456
  441. RELYT_DATABASE=postgres
  442. # open search configuration, only available when VECTOR_STORE is `opensearch`
  443. OPENSEARCH_HOST=opensearch
  444. OPENSEARCH_PORT=9200
  445. OPENSEARCH_USER=admin
  446. OPENSEARCH_PASSWORD=admin
  447. OPENSEARCH_SECURE=true
  448. # tencent vector configurations, only available when VECTOR_STORE is `tencent`
  449. TENCENT_VECTOR_DB_URL=http://127.0.0.1
  450. TENCENT_VECTOR_DB_API_KEY=dify
  451. TENCENT_VECTOR_DB_TIMEOUT=30
  452. TENCENT_VECTOR_DB_USERNAME=dify
  453. TENCENT_VECTOR_DB_DATABASE=dify
  454. TENCENT_VECTOR_DB_SHARD=1
  455. TENCENT_VECTOR_DB_REPLICAS=2
  456. # ElasticSearch configuration, only available when VECTOR_STORE is `elasticsearch`
  457. ELASTICSEARCH_HOST=0.0.0.0
  458. ELASTICSEARCH_PORT=9200
  459. ELASTICSEARCH_USERNAME=elastic
  460. ELASTICSEARCH_PASSWORD=elastic
  461. # baidu vector configurations, only available when VECTOR_STORE is `baidu`
  462. BAIDU_VECTOR_DB_ENDPOINT=http://127.0.0.1:5287
  463. BAIDU_VECTOR_DB_CONNECTION_TIMEOUT_MS=30000
  464. BAIDU_VECTOR_DB_ACCOUNT=root
  465. BAIDU_VECTOR_DB_API_KEY=dify
  466. BAIDU_VECTOR_DB_DATABASE=dify
  467. BAIDU_VECTOR_DB_SHARD=1
  468. BAIDU_VECTOR_DB_REPLICAS=3
  469. # VikingDB configurations, only available when VECTOR_STORE is `vikingdb`
  470. VIKINGDB_ACCESS_KEY=your-ak
  471. VIKINGDB_SECRET_KEY=your-sk
  472. VIKINGDB_REGION=cn-shanghai
  473. VIKINGDB_HOST=api-vikingdb.xxx.volces.com
  474. VIKINGDB_SCHEMA=http
  475. VIKINGDB_CONNECTION_TIMEOUT=30
  476. VIKINGDB_SOCKET_TIMEOUT=30
  477. # Lindorm configuration, only available when VECTOR_STORE is `lindorm`
  478. LINDORM_URL=http://ld-***************-proxy-search-pub.lindorm.aliyuncs.com:30070
  479. LINDORM_USERNAME=username
  480. LINDORM_PASSWORD=password
  481. # OceanBase Vector configuration, only available when VECTOR_STORE is `oceanbase`
  482. OCEANBASE_VECTOR_HOST=oceanbase
  483. OCEANBASE_VECTOR_PORT=2881
  484. OCEANBASE_VECTOR_USER=root@test
  485. OCEANBASE_VECTOR_PASSWORD=difyai123456
  486. OCEANBASE_VECTOR_DATABASE=test
  487. OCEANBASE_MEMORY_LIMIT=6G
  488. # ------------------------------
  489. # Knowledge Configuration
  490. # ------------------------------
  491. # Upload file size limit, default 15M.
  492. UPLOAD_FILE_SIZE_LIMIT=15
  493. # The maximum number of files that can be uploaded at a time, default 5.
  494. UPLOAD_FILE_BATCH_LIMIT=5
  495. # ETL type, support: `dify`, `Unstructured`
  496. # `dify` Dify's proprietary file extraction scheme
  497. # `Unstructured` Unstructured.io file extraction scheme
  498. ETL_TYPE=dify
  499. # Unstructured API path and API key, needs to be configured when ETL_TYPE is Unstructured
  500. # Or using Unstructured for document extractor node for pptx.
  501. # For example: http://unstructured:8000/general/v0/general
  502. UNSTRUCTURED_API_URL=
  503. UNSTRUCTURED_API_KEY=
  504. SCARF_NO_ANALYTICS=true
  505. # ------------------------------
  506. # Model Configuration
  507. # ------------------------------
  508. # The maximum number of tokens allowed for prompt generation.
  509. # This setting controls the upper limit of tokens that can be used by the LLM
  510. # when generating a prompt in the prompt generation tool.
  511. # Default: 512 tokens.
  512. PROMPT_GENERATION_MAX_TOKENS=512
  513. # The maximum number of tokens allowed for code generation.
  514. # This setting controls the upper limit of tokens that can be used by the LLM
  515. # when generating code in the code generation tool.
  516. # Default: 1024 tokens.
  517. CODE_GENERATION_MAX_TOKENS=1024
  518. # ------------------------------
  519. # Multi-modal Configuration
  520. # ------------------------------
  521. # The format of the image/video sent when the multi-modal model is input,
  522. # the default is base64, optional url.
  523. # The delay of the call in url mode will be lower than that in base64 mode.
  524. # It is generally recommended to use the more compatible base64 mode.
  525. # If configured as url, you need to configure FILES_URL as an externally accessible address so that the multi-modal model can access the image/video.
  526. MULTIMODAL_SEND_IMAGE_FORMAT=base64
  527. MULTIMODAL_SEND_VIDEO_FORMAT=base64
  528. # Upload image file size limit, default 10M.
  529. UPLOAD_IMAGE_FILE_SIZE_LIMIT=10
  530. # Upload video file size limit, default 100M.
  531. UPLOAD_VIDEO_FILE_SIZE_LIMIT=100
  532. # Upload audio file size limit, default 50M.
  533. UPLOAD_AUDIO_FILE_SIZE_LIMIT=50
  534. # ------------------------------
  535. # Sentry Configuration
  536. # Used for application monitoring and error log tracking.
  537. # ------------------------------
  538. # API Service Sentry DSN address, default is empty, when empty,
  539. # all monitoring information is not reported to Sentry.
  540. # If not set, Sentry error reporting will be disabled.
  541. API_SENTRY_DSN=
  542. # API Service The reporting ratio of Sentry events, if it is 0.01, it is 1%.
  543. API_SENTRY_TRACES_SAMPLE_RATE=1.0
  544. # API Service The reporting ratio of Sentry profiles, if it is 0.01, it is 1%.
  545. API_SENTRY_PROFILES_SAMPLE_RATE=1.0
  546. # Web Service Sentry DSN address, default is empty, when empty,
  547. # all monitoring information is not reported to Sentry.
  548. # If not set, Sentry error reporting will be disabled.
  549. WEB_SENTRY_DSN=
  550. # ------------------------------
  551. # Notion Integration Configuration
  552. # Variables can be obtained by applying for Notion integration: https://www.notion.so/my-integrations
  553. # ------------------------------
  554. # Configure as "public" or "internal".
  555. # Since Notion's OAuth redirect URL only supports HTTPS,
  556. # if deploying locally, please use Notion's internal integration.
  557. NOTION_INTEGRATION_TYPE=public
  558. # Notion OAuth client secret (used for public integration type)
  559. NOTION_CLIENT_SECRET=
  560. # Notion OAuth client id (used for public integration type)
  561. NOTION_CLIENT_ID=
  562. # Notion internal integration secret.
  563. # If the value of NOTION_INTEGRATION_TYPE is "internal",
  564. # you need to configure this variable.
  565. NOTION_INTERNAL_SECRET=
  566. # ------------------------------
  567. # Mail related configuration
  568. # ------------------------------
  569. # Mail type, support: resend, smtp
  570. MAIL_TYPE=resend
  571. # Default send from email address, if not specified
  572. MAIL_DEFAULT_SEND_FROM=
  573. # API-Key for the Resend email provider, used when MAIL_TYPE is `resend`.
  574. RESEND_API_KEY=your-resend-api-key
  575. # SMTP server configuration, used when MAIL_TYPE is `smtp`
  576. SMTP_SERVER=
  577. SMTP_PORT=465
  578. SMTP_USERNAME=
  579. SMTP_PASSWORD=
  580. SMTP_USE_TLS=true
  581. SMTP_OPPORTUNISTIC_TLS=false
  582. # ------------------------------
  583. # Others Configuration
  584. # ------------------------------
  585. # Maximum length of segmentation tokens for indexing
  586. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
  587. # Member invitation link valid time (hours),
  588. # Default: 72.
  589. INVITE_EXPIRY_HOURS=72
  590. # Reset password token valid time (minutes),
  591. RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
  592. # The sandbox service endpoint.
  593. CODE_EXECUTION_ENDPOINT=http://sandbox:8194
  594. CODE_MAX_NUMBER=9223372036854775807
  595. CODE_MIN_NUMBER=-9223372036854775808
  596. CODE_MAX_DEPTH=5
  597. CODE_MAX_PRECISION=20
  598. CODE_MAX_STRING_LENGTH=80000
  599. TEMPLATE_TRANSFORM_MAX_LENGTH=80000
  600. CODE_MAX_STRING_ARRAY_LENGTH=30
  601. CODE_MAX_OBJECT_ARRAY_LENGTH=30
  602. CODE_MAX_NUMBER_ARRAY_LENGTH=1000
  603. CODE_EXECUTION_CONNECT_TIMEOUT=10
  604. CODE_EXECUTION_READ_TIMEOUT=60
  605. CODE_EXECUTION_WRITE_TIMEOUT=10
  606. # Workflow runtime configuration
  607. WORKFLOW_MAX_EXECUTION_STEPS=500
  608. WORKFLOW_MAX_EXECUTION_TIME=1200
  609. WORKFLOW_CALL_MAX_DEPTH=5
  610. MAX_VARIABLE_SIZE=204800
  611. WORKFLOW_FILE_UPLOAD_LIMIT=10
  612. # HTTP request node in workflow configuration
  613. HTTP_REQUEST_NODE_MAX_BINARY_SIZE=10485760
  614. HTTP_REQUEST_NODE_MAX_TEXT_SIZE=1048576
  615. # SSRF Proxy server HTTP URL
  616. SSRF_PROXY_HTTP_URL=http://ssrf_proxy:3128
  617. # SSRF Proxy server HTTPS URL
  618. SSRF_PROXY_HTTPS_URL=http://ssrf_proxy:3128
  619. # ------------------------------
  620. # Environment Variables for web Service
  621. # ------------------------------
  622. # The timeout for the text generation in millisecond
  623. TEXT_GENERATION_TIMEOUT_MS=60000
  624. # ------------------------------
  625. # Environment Variables for db Service
  626. # ------------------------------
  627. PGUSER=${DB_USERNAME}
  628. # The password for the default postgres user.
  629. POSTGRES_PASSWORD=${DB_PASSWORD}
  630. # The name of the default postgres database.
  631. POSTGRES_DB=${DB_DATABASE}
  632. # postgres data directory
  633. PGDATA=/var/lib/postgresql/data/pgdata
  634. # ------------------------------
  635. # Environment Variables for sandbox Service
  636. # ------------------------------
  637. # The API key for the sandbox service
  638. SANDBOX_API_KEY=dify-sandbox
  639. # The mode in which the Gin framework runs
  640. SANDBOX_GIN_MODE=release
  641. # The timeout for the worker in seconds
  642. SANDBOX_WORKER_TIMEOUT=15
  643. # Enable network for the sandbox service
  644. SANDBOX_ENABLE_NETWORK=true
  645. # HTTP proxy URL for SSRF protection
  646. SANDBOX_HTTP_PROXY=http://ssrf_proxy:3128
  647. # HTTPS proxy URL for SSRF protection
  648. SANDBOX_HTTPS_PROXY=http://ssrf_proxy:3128
  649. # The port on which the sandbox service runs
  650. SANDBOX_PORT=8194
  651. # ------------------------------
  652. # Environment Variables for weaviate Service
  653. # (only used when VECTOR_STORE is weaviate)
  654. # ------------------------------
  655. WEAVIATE_PERSISTENCE_DATA_PATH=/var/lib/weaviate
  656. WEAVIATE_QUERY_DEFAULTS_LIMIT=25
  657. WEAVIATE_AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true
  658. WEAVIATE_DEFAULT_VECTORIZER_MODULE=none
  659. WEAVIATE_CLUSTER_HOSTNAME=node1
  660. WEAVIATE_AUTHENTICATION_APIKEY_ENABLED=true
  661. WEAVIATE_AUTHENTICATION_APIKEY_ALLOWED_KEYS=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  662. WEAVIATE_AUTHENTICATION_APIKEY_USERS=hello@dify.ai
  663. WEAVIATE_AUTHORIZATION_ADMINLIST_ENABLED=true
  664. WEAVIATE_AUTHORIZATION_ADMINLIST_USERS=hello@dify.ai
  665. # ------------------------------
  666. # Environment Variables for Chroma
  667. # (only used when VECTOR_STORE is chroma)
  668. # ------------------------------
  669. # Authentication credentials for Chroma server
  670. CHROMA_SERVER_AUTHN_CREDENTIALS=difyai123456
  671. # Authentication provider for Chroma server
  672. CHROMA_SERVER_AUTHN_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
  673. # Persistence setting for Chroma server
  674. CHROMA_IS_PERSISTENT=TRUE
  675. # ------------------------------
  676. # Environment Variables for Oracle Service
  677. # (only used when VECTOR_STORE is Oracle)
  678. # ------------------------------
  679. ORACLE_PWD=Dify123456
  680. ORACLE_CHARACTERSET=AL32UTF8
  681. # ------------------------------
  682. # Environment Variables for milvus Service
  683. # (only used when VECTOR_STORE is milvus)
  684. # ------------------------------
  685. # ETCD configuration for auto compaction mode
  686. ETCD_AUTO_COMPACTION_MODE=revision
  687. # ETCD configuration for auto compaction retention in terms of number of revisions
  688. ETCD_AUTO_COMPACTION_RETENTION=1000
  689. # ETCD configuration for backend quota in bytes
  690. ETCD_QUOTA_BACKEND_BYTES=4294967296
  691. # ETCD configuration for the number of changes before triggering a snapshot
  692. ETCD_SNAPSHOT_COUNT=50000
  693. # MinIO access key for authentication
  694. MINIO_ACCESS_KEY=minioadmin
  695. # MinIO secret key for authentication
  696. MINIO_SECRET_KEY=minioadmin
  697. # ETCD service endpoints
  698. ETCD_ENDPOINTS=etcd:2379
  699. # MinIO service address
  700. MINIO_ADDRESS=minio:9000
  701. # Enable or disable security authorization
  702. MILVUS_AUTHORIZATION_ENABLED=true
  703. # ------------------------------
  704. # Environment Variables for pgvector / pgvector-rs Service
  705. # (only used when VECTOR_STORE is pgvector / pgvector-rs)
  706. # ------------------------------
  707. PGVECTOR_PGUSER=postgres
  708. # The password for the default postgres user.
  709. PGVECTOR_POSTGRES_PASSWORD=difyai123456
  710. # The name of the default postgres database.
  711. PGVECTOR_POSTGRES_DB=dify
  712. # postgres data directory
  713. PGVECTOR_PGDATA=/var/lib/postgresql/data/pgdata
  714. # ------------------------------
  715. # Environment Variables for opensearch
  716. # (only used when VECTOR_STORE is opensearch)
  717. # ------------------------------
  718. OPENSEARCH_DISCOVERY_TYPE=single-node
  719. OPENSEARCH_BOOTSTRAP_MEMORY_LOCK=true
  720. OPENSEARCH_JAVA_OPTS_MIN=512m
  721. OPENSEARCH_JAVA_OPTS_MAX=1024m
  722. OPENSEARCH_INITIAL_ADMIN_PASSWORD=Qazwsxedc!@#123
  723. OPENSEARCH_MEMLOCK_SOFT=-1
  724. OPENSEARCH_MEMLOCK_HARD=-1
  725. OPENSEARCH_NOFILE_SOFT=65536
  726. OPENSEARCH_NOFILE_HARD=65536
  727. # ------------------------------
  728. # Environment Variables for Nginx reverse proxy
  729. # ------------------------------
  730. NGINX_SERVER_NAME=_
  731. NGINX_HTTPS_ENABLED=false
  732. # HTTP port
  733. NGINX_PORT=80
  734. # SSL settings are only applied when HTTPS_ENABLED is true
  735. NGINX_SSL_PORT=443
  736. # if HTTPS_ENABLED is true, you're required to add your own SSL certificates/keys to the `./nginx/ssl` directory
  737. # and modify the env vars below accordingly.
  738. NGINX_SSL_CERT_FILENAME=dify.crt
  739. NGINX_SSL_CERT_KEY_FILENAME=dify.key
  740. NGINX_SSL_PROTOCOLS=TLSv1.1 TLSv1.2 TLSv1.3
  741. # Nginx performance tuning
  742. NGINX_WORKER_PROCESSES=auto
  743. NGINX_CLIENT_MAX_BODY_SIZE=15M
  744. NGINX_KEEPALIVE_TIMEOUT=65
  745. # Proxy settings
  746. NGINX_PROXY_READ_TIMEOUT=3600s
  747. NGINX_PROXY_SEND_TIMEOUT=3600s
  748. # Set true to accept requests for /.well-known/acme-challenge/
  749. NGINX_ENABLE_CERTBOT_CHALLENGE=false
  750. # ------------------------------
  751. # Certbot Configuration
  752. # ------------------------------
  753. # Email address (required to get certificates from Let's Encrypt)
  754. CERTBOT_EMAIL=your_email@example.com
  755. # Domain name
  756. CERTBOT_DOMAIN=your_domain.com
  757. # certbot command options
  758. # i.e: --force-renewal --dry-run --test-cert --debug
  759. CERTBOT_OPTIONS=
  760. # ------------------------------
  761. # Environment Variables for SSRF Proxy
  762. # ------------------------------
  763. SSRF_HTTP_PORT=3128
  764. SSRF_COREDUMP_DIR=/var/spool/squid
  765. SSRF_REVERSE_PROXY_PORT=8194
  766. SSRF_SANDBOX_HOST=sandbox
  767. # ------------------------------
  768. # docker env var for specifying vector db type at startup
  769. # (based on the vector db type, the corresponding docker
  770. # compose profile will be used)
  771. # if you want to use unstructured, add ',unstructured' to the end
  772. # ------------------------------
  773. COMPOSE_PROFILES=${VECTOR_STORE:-weaviate}
  774. # ------------------------------
  775. # Docker Compose Service Expose Host Port Configurations
  776. # ------------------------------
  777. EXPOSE_NGINX_PORT=80
  778. EXPOSE_NGINX_SSL_PORT=443
  779. # ----------------------------------------------------------------------------
  780. # ModelProvider & Tool Position Configuration
  781. # Used to specify the model providers and tools that can be used in the app.
  782. # ----------------------------------------------------------------------------
  783. # Pin, include, and exclude tools
  784. # Use comma-separated values with no spaces between items.
  785. # Example: POSITION_TOOL_PINS=bing,google
  786. POSITION_TOOL_PINS=
  787. POSITION_TOOL_INCLUDES=
  788. POSITION_TOOL_EXCLUDES=
  789. # Pin, include, and exclude model providers
  790. # Use comma-separated values with no spaces between items.
  791. # Example: POSITION_PROVIDER_PINS=openai,openllm
  792. POSITION_PROVIDER_PINS=
  793. POSITION_PROVIDER_INCLUDES=
  794. POSITION_PROVIDER_EXCLUDES=
  795. # CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
  796. CSP_WHITELIST=
  797. # Enable or disable create tidb service job
  798. CREATE_TIDB_SERVICE_JOB_ENABLED=false