.env.example 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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. # Debug mode, default is false.
  43. # It is recommended to turn on this configuration for local development
  44. # to prevent some problems caused by monkey patch.
  45. DEBUG=false
  46. # Flask debug mode, it can output trace information at the interface when turned on,
  47. # which is convenient for debugging.
  48. FLASK_DEBUG=false
  49. # A secretkey that is used for securely signing the session cookie
  50. # and encrypting sensitive information on the database.
  51. # You can generate a strong key using `openssl rand -base64 42`.
  52. SECRET_KEY=sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
  53. # Password for admin user initialization.
  54. # If left unset, admin user will not be prompted for a password
  55. # when creating the initial admin account.
  56. INIT_PASSWORD=
  57. # Deployment environment.
  58. # Supported values are `PRODUCTION`, `TESTING`. Default is `PRODUCTION`.
  59. # Testing environment. There will be a distinct color label on the front-end page,
  60. # indicating that this environment is a testing environment.
  61. DEPLOY_ENV=PRODUCTION
  62. # Whether to enable the version check policy.
  63. # If set to empty, https://updates.dify.ai will not be called for version check.
  64. CHECK_UPDATE_URL=https://updates.dify.ai
  65. # Used to change the OpenAI base address, default is https://api.openai.com/v1.
  66. # When OpenAI cannot be accessed in China, replace it with a domestic mirror address,
  67. # or when a local model provides OpenAI compatible API, it can be replaced.
  68. OPENAI_API_BASE=https://api.openai.com/v1
  69. # When enabled, migrations will be executed prior to application startup
  70. # and the application will start after the migrations have completed.
  71. MIGRATION_ENABLED=true
  72. # File Access Time specifies a time interval in seconds for the file to be accessed.
  73. # The default value is 300 seconds.
  74. FILES_ACCESS_TIMEOUT=300
  75. # The maximum number of active requests for the application, where 0 means unlimited, should be a non-negative integer.
  76. APP_MAX_ACTIVE_REQUESTS=0
  77. # ------------------------------
  78. # Container Startup Related Configuration
  79. # Only effective when starting with docker image or docker-compose.
  80. # ------------------------------
  81. # API service binding address, default: 0.0.0.0, i.e., all addresses can be accessed.
  82. DIFY_BIND_ADDRESS=0.0.0.0
  83. # API service binding port number, default 5001.
  84. DIFY_PORT=5001
  85. # The number of API server workers, i.e., the number of gevent workers.
  86. # Formula: number of cpu cores x 2 + 1
  87. # Reference: https://docs.gunicorn.org/en/stable/design.html#how-many-workers
  88. SERVER_WORKER_AMOUNT=
  89. # Defaults to gevent. If using windows, it can be switched to sync or solo.
  90. SERVER_WORKER_CLASS=
  91. # Similar to SERVER_WORKER_CLASS. Default is gevent.
  92. # If using windows, it can be switched to sync or solo.
  93. CELERY_WORKER_CLASS=
  94. # Request handling timeout. The default is 200,
  95. # it is recommended to set it to 360 to support a longer sse connection time.
  96. GUNICORN_TIMEOUT=360
  97. # The number of Celery workers. The default is 1, and can be set as needed.
  98. CELERY_WORKER_AMOUNT=
  99. # Flag indicating whether to enable autoscaling of Celery workers.
  100. #
  101. # Autoscaling is useful when tasks are CPU intensive and can be dynamically
  102. # allocated and deallocated based on the workload.
  103. #
  104. # When autoscaling is enabled, the maximum and minimum number of workers can
  105. # be specified. The autoscaling algorithm will dynamically adjust the number
  106. # of workers within the specified range.
  107. #
  108. # Default is false (i.e., autoscaling is disabled).
  109. #
  110. # Example:
  111. # CELERY_AUTO_SCALE=true
  112. CELERY_AUTO_SCALE=false
  113. # The maximum number of Celery workers that can be autoscaled.
  114. # This is optional and only used when autoscaling is enabled.
  115. # Default is not set.
  116. CELERY_MAX_WORKERS=
  117. # The minimum number of Celery workers that can be autoscaled.
  118. # This is optional and only used when autoscaling is enabled.
  119. # Default is not set.
  120. CELERY_MIN_WORKERS=
  121. # API Tool configuration
  122. API_TOOL_DEFAULT_CONNECT_TIMEOUT=10
  123. API_TOOL_DEFAULT_READ_TIMEOUT=60
  124. # ------------------------------
  125. # Database Configuration
  126. # The database uses PostgreSQL. Please use the public schema.
  127. # It is consistent with the configuration in the 'db' service below.
  128. # ------------------------------
  129. DB_USERNAME=postgres
  130. DB_PASSWORD=difyai123456
  131. DB_HOST=db
  132. DB_PORT=5432
  133. DB_DATABASE=dify
  134. # The size of the database connection pool.
  135. # The default is 30 connections, which can be appropriately increased.
  136. SQLALCHEMY_POOL_SIZE=30
  137. # Database connection pool recycling time, the default is 3600 seconds.
  138. SQLALCHEMY_POOL_RECYCLE=3600
  139. # Whether to print SQL, default is false.
  140. SQLALCHEMY_ECHO=false
  141. # Maximum number of connections to the database
  142. # Default is 100
  143. #
  144. # Reference: https://www.postgresql.org/docs/current/runtime-config-connection.html#GUC-MAX-CONNECTIONS
  145. POSTGRES_MAX_CONNECTIONS=100
  146. # Sets the amount of shared memory used for postgres's shared buffers.
  147. # Default is 128MB
  148. # Recommended value: 25% of available memory
  149. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-SHARED-BUFFERS
  150. POSTGRES_SHARED_BUFFERS=128MB
  151. # Sets the amount of memory used by each database worker for working space.
  152. # Default is 4MB
  153. #
  154. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-WORK-MEM
  155. POSTGRES_WORK_MEM=4MB
  156. # Sets the amount of memory reserved for maintenance activities.
  157. # Default is 64MB
  158. #
  159. # Reference: https://www.postgresql.org/docs/current/runtime-config-resource.html#GUC-MAINTENANCE-WORK-MEM
  160. POSTGRES_MAINTENANCE_WORK_MEM=64MB
  161. # Sets the planner's assumption about the effective cache size.
  162. # Default is 4096MB
  163. #
  164. # Reference: https://www.postgresql.org/docs/current/runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE
  165. POSTGRES_EFFECTIVE_CACHE_SIZE=4096MB
  166. # ------------------------------
  167. # Redis Configuration
  168. # This Redis configuration is used for caching and for pub/sub during conversation.
  169. # ------------------------------
  170. REDIS_HOST=redis
  171. REDIS_PORT=6379
  172. REDIS_USERNAME=
  173. REDIS_PASSWORD=difyai123456
  174. REDIS_USE_SSL=false
  175. # ------------------------------
  176. # Celery Configuration
  177. # ------------------------------
  178. # Use redis as the broker, and redis db 1 for celery broker.
  179. # Format as follows: `redis://<redis_username>:<redis_password>@<redis_host>:<redis_port>/<redis_database>`
  180. # Example: redis://:difyai123456@redis:6379/1
  181. CELERY_BROKER_URL=redis://:difyai123456@redis:6379/1
  182. BROKER_USE_SSL=false
  183. # ------------------------------
  184. # CORS Configuration
  185. # Used to set the front-end cross-domain access policy.
  186. # ------------------------------
  187. # Specifies the allowed origins for cross-origin requests to the Web API,
  188. # e.g. https://dify.app or * for all origins.
  189. WEB_API_CORS_ALLOW_ORIGINS=*
  190. # Specifies the allowed origins for cross-origin requests to the console API,
  191. # e.g. https://cloud.dify.ai or * for all origins.
  192. CONSOLE_CORS_ALLOW_ORIGINS=*
  193. # ------------------------------
  194. # File Storage Configuration
  195. # ------------------------------
  196. # The type of storage to use for storing user files.
  197. # Supported values are `local` and `s3` and `azure-blob` and `google-storage` and `tencent-cos`,
  198. # Default: `local`
  199. STORAGE_TYPE=local
  200. # S3 Configuration
  201. # Whether to use AWS managed IAM roles for authenticating with the S3 service.
  202. # If set to false, the access key and secret key must be provided.
  203. S3_USE_AWS_MANAGED_IAM=false
  204. # The endpoint of the S3 service.
  205. S3_ENDPOINT=
  206. # The region of the S3 service.
  207. S3_REGION=us-east-1
  208. # The name of the S3 bucket to use for storing files.
  209. S3_BUCKET_NAME=difyai
  210. # The access key to use for authenticating with the S3 service.
  211. S3_ACCESS_KEY=
  212. # The secret key to use for authenticating with the S3 service.
  213. S3_SECRET_KEY=
  214. # Azure Blob Configuration
  215. # The name of the Azure Blob Storage account to use for storing files.
  216. AZURE_BLOB_ACCOUNT_NAME=difyai
  217. # The access key to use for authenticating with the Azure Blob Storage account.
  218. AZURE_BLOB_ACCOUNT_KEY=difyai
  219. # The name of the Azure Blob Storage container to use for storing files.
  220. AZURE_BLOB_CONTAINER_NAME=difyai-container
  221. # The URL of the Azure Blob Storage account.
  222. AZURE_BLOB_ACCOUNT_URL=https://<your_account_name>.blob.core.windows.net
  223. # Google Storage Configuration
  224. # The name of the Google Storage bucket to use for storing files.
  225. GOOGLE_STORAGE_BUCKET_NAME=your-bucket-name
  226. # The service account JSON key to use for authenticating with the Google Storage service.
  227. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64=your-google-service-account-json-base64-string
  228. # The Alibaba Cloud OSS configurations,
  229. # only available when STORAGE_TYPE is `aliyun-oss`
  230. ALIYUN_OSS_BUCKET_NAME=your-bucket-name
  231. ALIYUN_OSS_ACCESS_KEY=your-access-key
  232. ALIYUN_OSS_SECRET_KEY=your-secret-key
  233. ALIYUN_OSS_ENDPOINT=https://oss-ap-southeast-1-internal.aliyuncs.com
  234. ALIYUN_OSS_REGION=ap-southeast-1
  235. ALIYUN_OSS_AUTH_VERSION=v4
  236. # Tencent COS Configuration
  237. # The name of the Tencent COS bucket to use for storing files.
  238. TENCENT_COS_BUCKET_NAME=your-bucket-name
  239. # The secret key to use for authenticating with the Tencent COS service.
  240. TENCENT_COS_SECRET_KEY=your-secret-key
  241. # The secret id to use for authenticating with the Tencent COS service.
  242. TENCENT_COS_SECRET_ID=your-secret-id
  243. # The region of the Tencent COS service.
  244. TENCENT_COS_REGION=your-region
  245. # The scheme of the Tencent COS service.
  246. TENCENT_COS_SCHEME=your-scheme
  247. # ------------------------------
  248. # Vector Database Configuration
  249. # ------------------------------
  250. # The type of vector store to use.
  251. # Supported values are `weaviate`, `qdrant`, `milvus`, `myscale`, `relyt`, `pgvector`, `chroma`, `opensearch`, `tidb_vector`, `oracle`, `tencent`, `elasticsearch`.
  252. VECTOR_STORE=weaviate
  253. # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
  254. WEAVIATE_ENDPOINT=http://weaviate:8080
  255. # The Weaviate API key.
  256. WEAVIATE_API_KEY=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  257. # The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
  258. QDRANT_URL=http://qdrant:6333
  259. # The Qdrant API key.
  260. QDRANT_API_KEY=difyai123456
  261. # The Qdrant client timeout setting.
  262. QDRANT_CLIENT_TIMEOUT=20
  263. # The Qdrant client enable gRPC mode.
  264. QDRANT_GRPC_ENABLED=false
  265. # The Qdrant server gRPC mode PORT.
  266. QDRANT_GRPC_PORT=6334
  267. # Milvus configuration Only available when VECTOR_STORE is `milvus`.
  268. # The milvus host.
  269. MILVUS_HOST=127.0.0.1
  270. # The milvus host.
  271. MILVUS_PORT=19530
  272. # The milvus username.
  273. MILVUS_USER=root
  274. # The milvus password.
  275. MILVUS_PASSWORD=Milvus
  276. # The milvus tls switch.
  277. MILVUS_SECURE=false
  278. # MyScale configuration, only available when VECTOR_STORE is `myscale`
  279. # For multi-language support, please set MYSCALE_FTS_PARAMS with referring to:
  280. # https://myscale.com/docs/en/text-search/#understanding-fts-index-parameters
  281. MYSCALE_HOST=myscale
  282. MYSCALE_PORT=8123
  283. MYSCALE_USER=default
  284. MYSCALE_PASSWORD=
  285. MYSCALE_DATABASE=dify
  286. MYSCALE_FTS_PARAMS=
  287. # pgvector configurations, only available when VECTOR_STORE is `pgvecto-rs or pgvector`
  288. PGVECTOR_HOST=pgvector
  289. PGVECTOR_PORT=5432
  290. PGVECTOR_USER=postgres
  291. PGVECTOR_PASSWORD=difyai123456
  292. PGVECTOR_DATABASE=dify
  293. # TiDB vector configurations, only available when VECTOR_STORE is `tidb`
  294. TIDB_VECTOR_HOST=tidb
  295. TIDB_VECTOR_PORT=4000
  296. TIDB_VECTOR_USER=xxx.root
  297. TIDB_VECTOR_PASSWORD=xxxxxx
  298. TIDB_VECTOR_DATABASE=dify
  299. # Chroma configuration, only available when VECTOR_STORE is `chroma`
  300. CHROMA_HOST=127.0.0.1
  301. CHROMA_PORT=8000
  302. CHROMA_TENANT=default_tenant
  303. CHROMA_DATABASE=default_database
  304. CHROMA_AUTH_PROVIDER=chromadb.auth.token_authn.TokenAuthClientProvider
  305. CHROMA_AUTH_CREDENTIALS=xxxxxx
  306. # Oracle configuration, only available when VECTOR_STORE is `oracle`
  307. ORACLE_HOST=oracle
  308. ORACLE_PORT=1521
  309. ORACLE_USER=dify
  310. ORACLE_PASSWORD=dify
  311. ORACLE_DATABASE=FREEPDB1
  312. # relyt configurations, only available when VECTOR_STORE is `relyt`
  313. RELYT_HOST=db
  314. RELYT_PORT=5432
  315. RELYT_USER=postgres
  316. RELYT_PASSWORD=difyai123456
  317. RELYT_DATABASE=postgres
  318. # open search configuration, only available when VECTOR_STORE is `opensearch`
  319. OPENSEARCH_HOST=opensearch
  320. OPENSEARCH_PORT=9200
  321. OPENSEARCH_USER=admin
  322. OPENSEARCH_PASSWORD=admin
  323. OPENSEARCH_SECURE=true
  324. # tencent vector configurations, only available when VECTOR_STORE is `tencent`
  325. TENCENT_VECTOR_DB_URL=http://127.0.0.1
  326. TENCENT_VECTOR_DB_API_KEY=dify
  327. TENCENT_VECTOR_DB_TIMEOUT=30
  328. TENCENT_VECTOR_DB_USERNAME=dify
  329. TENCENT_VECTOR_DB_DATABASE=dify
  330. TENCENT_VECTOR_DB_SHARD=1
  331. TENCENT_VECTOR_DB_REPLICAS=2
  332. # ElasticSearch configuration, only available when VECTOR_STORE is `elasticsearch`
  333. ELASTICSEARCH_HOST=0.0.0.0
  334. ELASTICSEARCH_PORT=9200
  335. ELASTICSEARCH_USERNAME=elastic
  336. ELASTICSEARCH_PASSWORD=elastic
  337. # ------------------------------
  338. # Knowledge Configuration
  339. # ------------------------------
  340. # Upload file size limit, default 15M.
  341. UPLOAD_FILE_SIZE_LIMIT=15
  342. # The maximum number of files that can be uploaded at a time, default 5.
  343. UPLOAD_FILE_BATCH_LIMIT=5
  344. # ETl type, support: `dify`, `Unstructured`
  345. # `dify` Dify's proprietary file extraction scheme
  346. # `Unstructured` Unstructured.io file extraction scheme
  347. ETL_TYPE=dify
  348. # Unstructured API path, needs to be configured when ETL_TYPE is Unstructured.
  349. # For example: http://unstructured:8000/general/v0/general
  350. UNSTRUCTURED_API_URL=
  351. # ------------------------------
  352. # Multi-modal Configuration
  353. # ------------------------------
  354. # The format of the image sent when the multi-modal model is input,
  355. # the default is base64, optional url.
  356. # The delay of the call in url mode will be lower than that in base64 mode.
  357. # It is generally recommended to use the more compatible base64 mode.
  358. # 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.
  359. MULTIMODAL_SEND_IMAGE_FORMAT=base64
  360. # Upload image file size limit, default 10M.
  361. UPLOAD_IMAGE_FILE_SIZE_LIMIT=10
  362. # ------------------------------
  363. # Sentry Configuration
  364. # Used for application monitoring and error log tracking.
  365. # ------------------------------
  366. # API Service Sentry DSN address, default is empty, when empty,
  367. # all monitoring information is not reported to Sentry.
  368. # If not set, Sentry error reporting will be disabled.
  369. API_SENTRY_DSN=
  370. # API Service The reporting ratio of Sentry events, if it is 0.01, it is 1%.
  371. API_SENTRY_TRACES_SAMPLE_RATE=1.0
  372. # API Service The reporting ratio of Sentry profiles, if it is 0.01, it is 1%.
  373. API_SENTRY_PROFILES_SAMPLE_RATE=1.0
  374. # Web Service Sentry DSN address, default is empty, when empty,
  375. # all monitoring information is not reported to Sentry.
  376. # If not set, Sentry error reporting will be disabled.
  377. WEB_SENTRY_DSN=
  378. # ------------------------------
  379. # Notion Integration Configuration
  380. # Variables can be obtained by applying for Notion integration: https://www.notion.so/my-integrations
  381. # ------------------------------
  382. # Configure as "public" or "internal".
  383. # Since Notion's OAuth redirect URL only supports HTTPS,
  384. # if deploying locally, please use Notion's internal integration.
  385. NOTION_INTEGRATION_TYPE=public
  386. # Notion OAuth client secret (used for public integration type)
  387. NOTION_CLIENT_SECRET=
  388. # Notion OAuth client id (used for public integration type)
  389. NOTION_CLIENT_ID=
  390. # Notion internal integration secret.
  391. # If the value of NOTION_INTEGRATION_TYPE is "internal",
  392. # you need to configure this variable.
  393. NOTION_INTERNAL_SECRET=
  394. # ------------------------------
  395. # Mail related configuration
  396. # ------------------------------
  397. # Mail type, support: resend, smtp
  398. MAIL_TYPE=resend
  399. # Default send from email address, if not specified
  400. MAIL_DEFAULT_SEND_FROM=
  401. # API-Key for the Resend email provider, used when MAIL_TYPE is `resend`.
  402. RESEND_API_KEY=your-resend-api-key
  403. # SMTP server configuration, used when MAIL_TYPE is `smtp`
  404. SMTP_SERVER=
  405. SMTP_PORT=465
  406. SMTP_USERNAME=
  407. SMTP_PASSWORD=
  408. SMTP_USE_TLS=true
  409. SMTP_OPPORTUNISTIC_TLS=false
  410. # ------------------------------
  411. # Others Configuration
  412. # ------------------------------
  413. # Maximum length of segmentation tokens for indexing
  414. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=1000
  415. # Member invitation link valid time (hours),
  416. # Default: 72.
  417. INVITE_EXPIRY_HOURS=72
  418. # Reset password token valid time (hours),
  419. # Default: 24.
  420. RESET_PASSWORD_TOKEN_EXPIRY_HOURS=24
  421. # The sandbox service endpoint.
  422. CODE_EXECUTION_ENDPOINT=http://sandbox:8194
  423. CODE_MAX_NUMBER=9223372036854775807
  424. CODE_MIN_NUMBER=-9223372036854775808
  425. CODE_MAX_STRING_LENGTH=80000
  426. TEMPLATE_TRANSFORM_MAX_LENGTH=80000
  427. CODE_MAX_STRING_ARRAY_LENGTH=30
  428. CODE_MAX_OBJECT_ARRAY_LENGTH=30
  429. CODE_MAX_NUMBER_ARRAY_LENGTH=1000
  430. # SSRF Proxy server HTTP URL
  431. SSRF_PROXY_HTTP_URL=http://ssrf_proxy:3128
  432. # SSRF Proxy server HTTPS URL
  433. SSRF_PROXY_HTTPS_URL=http://ssrf_proxy:3128
  434. # ------------------------------
  435. # Environment Variables for db Service
  436. # ------------------------------
  437. PGUSER=${DB_USERNAME}
  438. # The password for the default postgres user.
  439. POSTGRES_PASSWORD=${DB_PASSWORD}
  440. # The name of the default postgres database.
  441. POSTGRES_DB=${DB_DATABASE}
  442. # postgres data directory
  443. PGDATA=/var/lib/postgresql/data/pgdata
  444. # ------------------------------
  445. # Environment Variables for sandbox Service
  446. # ------------------------------
  447. # The API key for the sandbox service
  448. SANDBOX_API_KEY=dify-sandbox
  449. # The mode in which the Gin framework runs
  450. SANDBOX_GIN_MODE=release
  451. # The timeout for the worker in seconds
  452. SANDBOX_WORKER_TIMEOUT=15
  453. # Enable network for the sandbox service
  454. SANDBOX_ENABLE_NETWORK=true
  455. # HTTP proxy URL for SSRF protection
  456. SANDBOX_HTTP_PROXY=http://ssrf_proxy:3128
  457. # HTTPS proxy URL for SSRF protection
  458. SANDBOX_HTTPS_PROXY=http://ssrf_proxy:3128
  459. # The port on which the sandbox service runs
  460. SANDBOX_PORT=8194
  461. # ------------------------------
  462. # Environment Variables for weaviate Service
  463. # (only used when VECTOR_STORE is weaviate)
  464. # ------------------------------
  465. WEAVIATE_PERSISTENCE_DATA_PATH='/var/lib/weaviate'
  466. WEAVIATE_QUERY_DEFAULTS_LIMIT=25
  467. WEAVIATE_AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED=true
  468. WEAVIATE_DEFAULT_VECTORIZER_MODULE=none
  469. WEAVIATE_CLUSTER_HOSTNAME=node1
  470. WEAVIATE_AUTHENTICATION_APIKEY_ENABLED=true
  471. WEAVIATE_AUTHENTICATION_APIKEY_ALLOWED_KEYS=WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  472. WEAVIATE_AUTHENTICATION_APIKEY_USERS=hello@dify.ai
  473. WEAVIATE_AUTHORIZATION_ADMINLIST_ENABLED=true
  474. WEAVIATE_AUTHORIZATION_ADMINLIST_USERS=hello@dify.ai
  475. # ------------------------------
  476. # Environment Variables for Chroma
  477. # (only used when VECTOR_STORE is chroma)
  478. # ------------------------------
  479. # Authentication credentials for Chroma server
  480. CHROMA_SERVER_AUTHN_CREDENTIALS=difyai123456
  481. # Authentication provider for Chroma server
  482. CHROMA_SERVER_AUTHN_PROVIDER=chromadb.auth.token_authn.TokenAuthenticationServerProvider
  483. # Persistence setting for Chroma server
  484. CHROMA_IS_PERSISTENT=TRUE
  485. # ------------------------------
  486. # Environment Variables for Oracle Service
  487. # (only used when VECTOR_STORE is Oracle)
  488. # ------------------------------
  489. ORACLE_PWD=Dify123456
  490. ORACLE_CHARACTERSET=AL32UTF8
  491. # ------------------------------
  492. # Environment Variables for milvus Service
  493. # (only used when VECTOR_STORE is milvus)
  494. # ------------------------------
  495. # ETCD configuration for auto compaction mode
  496. ETCD_AUTO_COMPACTION_MODE=revision
  497. # ETCD configuration for auto compaction retention in terms of number of revisions
  498. ETCD_AUTO_COMPACTION_RETENTION=1000
  499. # ETCD configuration for backend quota in bytes
  500. ETCD_QUOTA_BACKEND_BYTES=4294967296
  501. # ETCD configuration for the number of changes before triggering a snapshot
  502. ETCD_SNAPSHOT_COUNT=50000
  503. # MinIO access key for authentication
  504. MINIO_ACCESS_KEY=minioadmin
  505. # MinIO secret key for authentication
  506. MINIO_SECRET_KEY=minioadmin
  507. # ETCD service endpoints
  508. ETCD_ENDPOINTS=etcd:2379
  509. # MinIO service address
  510. MINIO_ADDRESS=minio:9000
  511. # Enable or disable security authorization
  512. MILVUS_AUTHORIZATION_ENABLED=true
  513. # ------------------------------
  514. # Environment Variables for pgvector / pgvector-rs Service
  515. # (only used when VECTOR_STORE is pgvector / pgvector-rs)
  516. # ------------------------------
  517. PGVECTOR_PGUSER=postgres
  518. # The password for the default postgres user.
  519. PGVECTOR_POSTGRES_PASSWORD=difyai123456
  520. # The name of the default postgres database.
  521. PGVECTOR_POSTGRES_DB=dify
  522. # postgres data directory
  523. PGVECTOR_PGDATA=/var/lib/postgresql/data/pgdata
  524. # ------------------------------
  525. # Environment Variables for opensearch
  526. # (only used when VECTOR_STORE is opensearch)
  527. # ------------------------------
  528. OPENSEARCH_DISCOVERY_TYPE=single-node
  529. OPENSEARCH_BOOTSTRAP_MEMORY_LOCK=true
  530. OPENSEARCH_JAVA_OPTS_MIN=512m
  531. OPENSEARCH_JAVA_OPTS_MAX=1024m
  532. OPENSEARCH_INITIAL_ADMIN_PASSWORD=Qazwsxedc!@#123
  533. OPENSEARCH_MEMLOCK_SOFT=-1
  534. OPENSEARCH_MEMLOCK_HARD=-1
  535. OPENSEARCH_NOFILE_SOFT=65536
  536. OPENSEARCH_NOFILE_HARD=65536
  537. # ------------------------------
  538. # Environment Variables for Nginx reverse proxy
  539. # ------------------------------
  540. NGINX_SERVER_NAME=_
  541. NGINX_HTTPS_ENABLED=false
  542. # HTTP port
  543. NGINX_PORT=80
  544. # SSL settings are only applied when HTTPS_ENABLED is true
  545. NGINX_SSL_PORT=443
  546. # if HTTPS_ENABLED is true, you're required to add your own SSL certificates/keys to the `./nginx/ssl` directory
  547. # and modify the env vars below accordingly.
  548. NGINX_SSL_CERT_FILENAME=dify.crt
  549. NGINX_SSL_CERT_KEY_FILENAME=dify.key
  550. NGINX_SSL_PROTOCOLS=TLSv1.1 TLSv1.2 TLSv1.3
  551. # Nginx performance tuning
  552. NGINX_WORKER_PROCESSES=auto
  553. NGINX_CLIENT_MAX_BODY_SIZE=15M
  554. NGINX_KEEPALIVE_TIMEOUT=65
  555. # Proxy settings
  556. NGINX_PROXY_READ_TIMEOUT=3600s
  557. NGINX_PROXY_SEND_TIMEOUT=3600s
  558. # Set true to accept requests for /.well-known/acme-challenge/
  559. NGINX_ENABLE_CERTBOT_CHALLENGE=false
  560. # ------------------------------
  561. # Certbot Configuration
  562. # ------------------------------
  563. # Email address (required to get certificates from Let's Encrypt)
  564. CERTBOT_EMAIL=your_email@example.com
  565. # Domain name
  566. CERTBOT_DOMAIN=your_domain.com
  567. # certbot command options
  568. # i.e: --force-renewal --dry-run --test-cert --debug
  569. CERTBOT_OPTIONS=
  570. # ------------------------------
  571. # Environment Variables for SSRF Proxy
  572. # ------------------------------
  573. SSRF_HTTP_PORT=3128
  574. SSRF_COREDUMP_DIR=/var/spool/squid
  575. SSRF_REVERSE_PROXY_PORT=8194
  576. SSRF_SANDBOX_HOST=sandbox
  577. # ------------------------------
  578. # docker env var for specifying vector db type at startup
  579. # (based on the vector db type, the corresponding docker
  580. # compose profile will be used)
  581. # if you want to use unstructured, add ',unstructured' to the end
  582. # ------------------------------
  583. COMPOSE_PROFILES=${VECTOR_STORE:-weaviate}
  584. # ------------------------------
  585. # Docker Compose Service Expose Host Port Configurations
  586. # ------------------------------
  587. EXPOSE_NGINX_PORT=80
  588. EXPOSE_NGINX_SSL_PORT=443
  589. # ----------------------------------------------------------------------------
  590. # ModelProvider & Tool Position Configuration
  591. # Used to specify the model providers and tools that can be used in the app.
  592. # ----------------------------------------------------------------------------
  593. # Pin, include, and exclude tools
  594. # Use comma-separated values with no spaces between items.
  595. # Example: POSITION_TOOL_PINS=bing,google
  596. POSITION_TOOL_PINS=
  597. POSITION_TOOL_INCLUDES=
  598. POSITION_TOOL_EXCLUDES=
  599. # Pin, include, and exclude model providers
  600. # Use comma-separated values with no spaces between items.
  601. # Example: POSITION_PROVIDER_PINS=openai,openllm
  602. POSITION_PROVIDER_PINS=
  603. POSITION_PROVIDER_INCLUDES=
  604. POSITION_PROVIDER_EXCLUDES=