docker-compose.yaml 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  1. version: '3'
  2. services:
  3. # API service
  4. api:
  5. image: langgenius/dify-api:0.11.0
  6. restart: always
  7. environment:
  8. # Startup mode, 'api' starts the API server.
  9. MODE: api
  10. # The log level for the application. Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
  11. LOG_LEVEL: INFO
  12. # enable DEBUG mode to output more logs
  13. # DEBUG : true
  14. # A secret key that is used for securely signing the session cookie and encrypting sensitive information on the database. You can generate a strong key using `openssl rand -base64 42`.
  15. SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
  16. # The base URL of console application web frontend, refers to the Console base URL of WEB service if console domain is
  17. # different from api or web app domain.
  18. # example: http://cloud.dify.ai
  19. CONSOLE_WEB_URL: ''
  20. # Password for admin user initialization.
  21. # If left unset, admin user will not be prompted for a password when creating the initial admin account.
  22. INIT_PASSWORD: ''
  23. # The base URL of console application api server, refers to the Console base URL of WEB service if console domain is
  24. # different from api or web app domain.
  25. # example: http://cloud.dify.ai
  26. CONSOLE_API_URL: ''
  27. # The URL prefix for Service API endpoints, refers to the base URL of the current API service if api domain is
  28. # different from console domain.
  29. # example: http://api.dify.ai
  30. SERVICE_API_URL: ''
  31. # The URL prefix for Web APP frontend, refers to the Web App base URL of WEB service if web app domain is different from
  32. # console or api domain.
  33. # example: http://udify.app
  34. APP_WEB_URL: ''
  35. # File preview or download Url prefix.
  36. # used to display File preview or download Url to the front-end or as Multi-model inputs;
  37. # Url is signed and has expiration time.
  38. FILES_URL: ''
  39. # File Access Time specifies a time interval in seconds for the file to be accessed.
  40. # The default value is 300 seconds.
  41. FILES_ACCESS_TIMEOUT: 300
  42. # The maximum number of active requests for the application, where 0 means unlimited, should be a non-negative integer.
  43. APP_MAX_ACTIVE_REQUESTS: 0
  44. # When enabled, migrations will be executed prior to application startup and the application will start after the migrations have completed.
  45. MIGRATION_ENABLED: 'true'
  46. # The configurations of postgres database connection.
  47. # It is consistent with the configuration in the 'db' service below.
  48. DB_USERNAME: postgres
  49. DB_PASSWORD: difyai123456
  50. DB_HOST: db
  51. DB_PORT: 5432
  52. DB_DATABASE: dify
  53. # The configurations of redis connection.
  54. # It is consistent with the configuration in the 'redis' service below.
  55. REDIS_HOST: redis
  56. REDIS_PORT: 6379
  57. REDIS_USERNAME: ''
  58. REDIS_PASSWORD: difyai123456
  59. REDIS_USE_SSL: 'false'
  60. # use redis db 0 for redis cache
  61. REDIS_DB: 0
  62. # The configurations of celery broker.
  63. # Use redis as the broker, and redis db 1 for celery broker.
  64. CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1
  65. # Specifies the allowed origins for cross-origin requests to the Web API, e.g. https://dify.app or * for all origins.
  66. WEB_API_CORS_ALLOW_ORIGINS: '*'
  67. # Specifies the allowed origins for cross-origin requests to the console API, e.g. https://cloud.dify.ai or * for all origins.
  68. CONSOLE_CORS_ALLOW_ORIGINS: '*'
  69. # CSRF Cookie settings
  70. # Controls whether a cookie is sent with cross-site requests,
  71. # providing some protection against cross-site request forgery attacks
  72. #
  73. # Default: `SameSite=Lax, Secure=false, HttpOnly=true`
  74. # This default configuration supports same-origin requests using either HTTP or HTTPS,
  75. # but does not support cross-origin requests. It is suitable for local debugging purposes.
  76. #
  77. # If you want to enable cross-origin support,
  78. # you must use the HTTPS protocol and set the configuration to `SameSite=None, Secure=true, HttpOnly=true`.
  79. #
  80. # The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
  81. STORAGE_TYPE: local
  82. # The path to the local storage directory, the directory relative the root path of API service codes or absolute path. Default: `storage` or `/home/john/storage`.
  83. # only available when STORAGE_TYPE is `local`.
  84. STORAGE_LOCAL_PATH: storage
  85. # The S3 storage configurations, only available when STORAGE_TYPE is `s3`.
  86. S3_USE_AWS_MANAGED_IAM: 'false'
  87. S3_ENDPOINT: 'https://xxx.r2.cloudflarestorage.com'
  88. S3_BUCKET_NAME: 'difyai'
  89. S3_ACCESS_KEY: 'ak-difyai'
  90. S3_SECRET_KEY: 'sk-difyai'
  91. S3_REGION: 'us-east-1'
  92. # The Azure Blob storage configurations, only available when STORAGE_TYPE is `azure-blob`.
  93. AZURE_BLOB_ACCOUNT_NAME: 'difyai'
  94. AZURE_BLOB_ACCOUNT_KEY: 'difyai'
  95. AZURE_BLOB_CONTAINER_NAME: 'difyai-container'
  96. AZURE_BLOB_ACCOUNT_URL: 'https://<your_account_name>.blob.core.windows.net'
  97. # The Google storage configurations, only available when STORAGE_TYPE is `google-storage`.
  98. GOOGLE_STORAGE_BUCKET_NAME: 'yout-bucket-name'
  99. # if you want to use Application Default Credentials, you can leave GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64 empty.
  100. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: 'your-google-service-account-json-base64-string'
  101. # The Alibaba Cloud OSS configurations, only available when STORAGE_TYPE is `aliyun-oss`
  102. ALIYUN_OSS_BUCKET_NAME: 'your-bucket-name'
  103. ALIYUN_OSS_ACCESS_KEY: 'your-access-key'
  104. ALIYUN_OSS_SECRET_KEY: 'your-secret-key'
  105. ALIYUN_OSS_ENDPOINT: 'https://oss-ap-southeast-1-internal.aliyuncs.com'
  106. ALIYUN_OSS_REGION: 'ap-southeast-1'
  107. ALIYUN_OSS_AUTH_VERSION: 'v4'
  108. # The Tencent COS storage configurations, only available when STORAGE_TYPE is `tencent-cos`.
  109. TENCENT_COS_BUCKET_NAME: 'your-bucket-name'
  110. TENCENT_COS_SECRET_KEY: 'your-secret-key'
  111. TENCENT_COS_SECRET_ID: 'your-secret-id'
  112. TENCENT_COS_REGION: 'your-region'
  113. TENCENT_COS_SCHEME: 'your-scheme'
  114. # The type of vector store to use. Supported values are `weaviate`, `qdrant`, `milvus`, `relyt`,`pgvector`, `chroma`, 'opensearch', 'tidb_vector'.
  115. VECTOR_STORE: weaviate
  116. # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
  117. WEAVIATE_ENDPOINT: http://weaviate:8080
  118. # The Weaviate API key.
  119. WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  120. # The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
  121. QDRANT_URL: http://qdrant:6333
  122. # The Qdrant API key.
  123. QDRANT_API_KEY: difyai123456
  124. # The Qdrant client timeout setting.
  125. QDRANT_CLIENT_TIMEOUT: 20
  126. # The Qdrant client enable gRPC mode.
  127. QDRANT_GRPC_ENABLED: 'false'
  128. # The Qdrant server gRPC mode PORT.
  129. QDRANT_GRPC_PORT: 6334
  130. # Milvus configuration Only available when VECTOR_STORE is `milvus`.
  131. # The milvus uri.
  132. MILVUS_URI: http://127.0.0.1:19530
  133. # The milvus token.
  134. MILVUS_TOKEN: ''
  135. # The milvus username.
  136. MILVUS_USER: root
  137. # The milvus password.
  138. MILVUS_PASSWORD: Milvus
  139. # relyt configurations
  140. RELYT_HOST: db
  141. RELYT_PORT: 5432
  142. RELYT_USER: postgres
  143. RELYT_PASSWORD: difyai123456
  144. RELYT_DATABASE: postgres
  145. # pgvector configurations
  146. PGVECTOR_HOST: pgvector
  147. PGVECTOR_PORT: 5432
  148. PGVECTOR_USER: postgres
  149. PGVECTOR_PASSWORD: difyai123456
  150. PGVECTOR_DATABASE: dify
  151. # tidb vector configurations
  152. TIDB_VECTOR_HOST: tidb
  153. TIDB_VECTOR_PORT: 4000
  154. TIDB_VECTOR_USER: xxx.root
  155. TIDB_VECTOR_PASSWORD: xxxxxx
  156. TIDB_VECTOR_DATABASE: dify
  157. # oracle configurations
  158. ORACLE_HOST: oracle
  159. ORACLE_PORT: 1521
  160. ORACLE_USER: dify
  161. ORACLE_PASSWORD: dify
  162. ORACLE_DATABASE: FREEPDB1
  163. # Chroma configuration
  164. CHROMA_HOST: 127.0.0.1
  165. CHROMA_PORT: 8000
  166. CHROMA_TENANT: default_tenant
  167. CHROMA_DATABASE: default_database
  168. CHROMA_AUTH_PROVIDER: chromadb.auth.token_authn.TokenAuthClientProvider
  169. CHROMA_AUTH_CREDENTIALS: xxxxxx
  170. # ElasticSearch Config
  171. ELASTICSEARCH_HOST: 127.0.0.1
  172. ELASTICSEARCH_PORT: 9200
  173. ELASTICSEARCH_USERNAME: elastic
  174. ELASTICSEARCH_PASSWORD: elastic
  175. # Mail configuration, support: resend, smtp
  176. MAIL_TYPE: ''
  177. # default send from email address, if not specified
  178. MAIL_DEFAULT_SEND_FROM: 'YOUR EMAIL FROM (eg: no-reply <no-reply@dify.ai>)'
  179. SMTP_SERVER: ''
  180. SMTP_PORT: 465
  181. SMTP_USERNAME: ''
  182. SMTP_PASSWORD: ''
  183. SMTP_USE_TLS: 'true'
  184. SMTP_OPPORTUNISTIC_TLS: 'false'
  185. # the api-key for resend (https://resend.com)
  186. RESEND_API_KEY: ''
  187. RESEND_API_URL: https://api.resend.com
  188. # The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
  189. SENTRY_DSN: ''
  190. # The sample rate for Sentry events. Default: `1.0`
  191. SENTRY_TRACES_SAMPLE_RATE: 1.0
  192. # The sample rate for Sentry profiles. Default: `1.0`
  193. SENTRY_PROFILES_SAMPLE_RATE: 1.0
  194. # Notion import configuration, support public and internal
  195. NOTION_INTEGRATION_TYPE: public
  196. NOTION_CLIENT_SECRET: you-client-secret
  197. NOTION_CLIENT_ID: you-client-id
  198. NOTION_INTERNAL_SECRET: you-internal-secret
  199. # The sandbox service endpoint.
  200. CODE_EXECUTION_ENDPOINT: "http://sandbox:8194"
  201. CODE_EXECUTION_API_KEY: dify-sandbox
  202. CODE_MAX_NUMBER: 9223372036854775807
  203. CODE_MIN_NUMBER: -9223372036854775808
  204. CODE_MAX_STRING_LENGTH: 80000
  205. TEMPLATE_TRANSFORM_MAX_LENGTH: 80000
  206. CODE_MAX_STRING_ARRAY_LENGTH: 30
  207. CODE_MAX_OBJECT_ARRAY_LENGTH: 30
  208. CODE_MAX_NUMBER_ARRAY_LENGTH: 1000
  209. # SSRF Proxy server
  210. SSRF_PROXY_HTTP_URL: 'http://ssrf_proxy:3128'
  211. SSRF_PROXY_HTTPS_URL: 'http://ssrf_proxy:3128'
  212. # Indexing configuration
  213. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
  214. depends_on:
  215. - db
  216. - redis
  217. volumes:
  218. # Mount the storage directory to the container, for storing user files.
  219. - ./volumes/app/storage:/app/api/storage
  220. # uncomment to expose dify-api port to host
  221. # ports:
  222. # - "5001:5001"
  223. networks:
  224. - ssrf_proxy_network
  225. - default
  226. # worker service
  227. # The Celery worker for processing the queue.
  228. worker:
  229. image: langgenius/dify-api:0.11.0
  230. restart: always
  231. environment:
  232. CONSOLE_WEB_URL: ''
  233. # Startup mode, 'worker' starts the Celery worker for processing the queue.
  234. MODE: worker
  235. # --- All the configurations below are the same as those in the 'api' service. ---
  236. # The log level for the application. Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
  237. LOG_LEVEL: INFO
  238. # A secret key that is used for securely signing the session cookie and encrypting sensitive information on the database. You can generate a strong key using `openssl rand -base64 42`.
  239. # same as the API service
  240. SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
  241. # The configurations of postgres database connection.
  242. # It is consistent with the configuration in the 'db' service below.
  243. DB_USERNAME: postgres
  244. DB_PASSWORD: difyai123456
  245. DB_HOST: db
  246. DB_PORT: 5432
  247. DB_DATABASE: dify
  248. # The configurations of redis cache connection.
  249. REDIS_HOST: redis
  250. REDIS_PORT: 6379
  251. REDIS_USERNAME: ''
  252. REDIS_PASSWORD: difyai123456
  253. REDIS_DB: 0
  254. REDIS_USE_SSL: 'false'
  255. # The configurations of celery broker.
  256. CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1
  257. # The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
  258. STORAGE_TYPE: local
  259. STORAGE_LOCAL_PATH: storage
  260. # The S3 storage configurations, only available when STORAGE_TYPE is `s3`.
  261. S3_USE_AWS_MANAGED_IAM: 'false'
  262. S3_ENDPOINT: 'https://xxx.r2.cloudflarestorage.com'
  263. S3_BUCKET_NAME: 'difyai'
  264. S3_ACCESS_KEY: 'ak-difyai'
  265. S3_SECRET_KEY: 'sk-difyai'
  266. S3_REGION: 'us-east-1'
  267. # The Azure Blob storage configurations, only available when STORAGE_TYPE is `azure-blob`.
  268. AZURE_BLOB_ACCOUNT_NAME: 'difyai'
  269. AZURE_BLOB_ACCOUNT_KEY: 'difyai'
  270. AZURE_BLOB_CONTAINER_NAME: 'difyai-container'
  271. AZURE_BLOB_ACCOUNT_URL: 'https://<your_account_name>.blob.core.windows.net'
  272. # The Google storage configurations, only available when STORAGE_TYPE is `google-storage`.
  273. GOOGLE_STORAGE_BUCKET_NAME: 'yout-bucket-name'
  274. # if you want to use Application Default Credentials, you can leave GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64 empty.
  275. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: 'your-google-service-account-json-base64-string'
  276. # The Alibaba Cloud OSS configurations, 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. # The Tencent COS storage configurations, only available when STORAGE_TYPE is `tencent-cos`.
  284. TENCENT_COS_BUCKET_NAME: 'your-bucket-name'
  285. TENCENT_COS_SECRET_KEY: 'your-secret-key'
  286. TENCENT_COS_SECRET_ID: 'your-secret-id'
  287. TENCENT_COS_REGION: 'your-region'
  288. TENCENT_COS_SCHEME: 'your-scheme'
  289. # The type of vector store to use. Supported values are `weaviate`, `qdrant`, `milvus`, `relyt`, `pgvector`, `chroma`, 'opensearch', 'tidb_vector'.
  290. VECTOR_STORE: weaviate
  291. # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
  292. WEAVIATE_ENDPOINT: http://weaviate:8080
  293. # The Weaviate API key.
  294. WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  295. # The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
  296. QDRANT_URL: http://qdrant:6333
  297. # The Qdrant API key.
  298. QDRANT_API_KEY: difyai123456
  299. # The Qdrant client timeout setting.
  300. QDRANT_CLIENT_TIMEOUT: 20
  301. # The Qdrant client enable gRPC mode.
  302. QDRANT_GRPC_ENABLED: 'false'
  303. # The Qdrant server gRPC mode PORT.
  304. QDRANT_GRPC_PORT: 6334
  305. # Milvus configuration Only available when VECTOR_STORE is `milvus`.
  306. # The milvus uri.
  307. MILVUS_URI: http://127.0.0.1:19530
  308. # The milvus token.
  309. MILVUS_PORT: ''
  310. # The milvus username.
  311. MILVUS_USER: root
  312. # The milvus password.
  313. MILVUS_PASSWORD: Milvus
  314. # Mail configuration, support: resend
  315. MAIL_TYPE: ''
  316. # default send from email address, if not specified
  317. MAIL_DEFAULT_SEND_FROM: 'YOUR EMAIL FROM (eg: no-reply <no-reply@dify.ai>)'
  318. SMTP_SERVER: ''
  319. SMTP_PORT: 465
  320. SMTP_USERNAME: ''
  321. SMTP_PASSWORD: ''
  322. SMTP_USE_TLS: 'true'
  323. SMTP_OPPORTUNISTIC_TLS: 'false'
  324. # the api-key for resend (https://resend.com)
  325. RESEND_API_KEY: ''
  326. RESEND_API_URL: https://api.resend.com
  327. # relyt configurations
  328. RELYT_HOST: db
  329. RELYT_PORT: 5432
  330. RELYT_USER: postgres
  331. RELYT_PASSWORD: difyai123456
  332. RELYT_DATABASE: postgres
  333. # tencent configurations
  334. TENCENT_VECTOR_DB_URL: http://127.0.0.1
  335. TENCENT_VECTOR_DB_API_KEY: dify
  336. TENCENT_VECTOR_DB_TIMEOUT: 30
  337. TENCENT_VECTOR_DB_USERNAME: dify
  338. TENCENT_VECTOR_DB_DATABASE: dify
  339. TENCENT_VECTOR_DB_SHARD: 1
  340. TENCENT_VECTOR_DB_REPLICAS: 2
  341. # OpenSearch configuration
  342. OPENSEARCH_HOST: 127.0.0.1
  343. OPENSEARCH_PORT: 9200
  344. OPENSEARCH_USER: admin
  345. OPENSEARCH_PASSWORD: admin
  346. OPENSEARCH_SECURE: 'true'
  347. # pgvector configurations
  348. PGVECTOR_HOST: pgvector
  349. PGVECTOR_PORT: 5432
  350. PGVECTOR_USER: postgres
  351. PGVECTOR_PASSWORD: difyai123456
  352. PGVECTOR_DATABASE: dify
  353. # tidb vector configurations
  354. TIDB_VECTOR_HOST: tidb
  355. TIDB_VECTOR_PORT: 4000
  356. TIDB_VECTOR_USER: xxx.root
  357. TIDB_VECTOR_PASSWORD: xxxxxx
  358. TIDB_VECTOR_DATABASE: dify
  359. # oracle configurations
  360. ORACLE_HOST: oracle
  361. ORACLE_PORT: 1521
  362. ORACLE_USER: dify
  363. ORACLE_PASSWORD: dify
  364. ORACLE_DATABASE: FREEPDB1
  365. # Chroma configuration
  366. CHROMA_HOST: 127.0.0.1
  367. CHROMA_PORT: 8000
  368. CHROMA_TENANT: default_tenant
  369. CHROMA_DATABASE: default_database
  370. CHROMA_AUTH_PROVIDER: chromadb.auth.token_authn.TokenAuthClientProvider
  371. CHROMA_AUTH_CREDENTIALS: xxxxxx
  372. # ElasticSearch Config
  373. ELASTICSEARCH_HOST: 127.0.0.1
  374. ELASTICSEARCH_PORT: 9200
  375. ELASTICSEARCH_USERNAME: elastic
  376. ELASTICSEARCH_PASSWORD: elastic
  377. # Notion import configuration, support public and internal
  378. NOTION_INTEGRATION_TYPE: public
  379. NOTION_CLIENT_SECRET: you-client-secret
  380. NOTION_CLIENT_ID: you-client-id
  381. NOTION_INTERNAL_SECRET: you-internal-secret
  382. # Indexing configuration
  383. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
  384. CREATE_TIDB_SERVICE_JOB_ENABLED: false
  385. depends_on:
  386. - db
  387. - redis
  388. volumes:
  389. # Mount the storage directory to the container, for storing user files.
  390. - ./volumes/app/storage:/app/api/storage
  391. networks:
  392. - ssrf_proxy_network
  393. - default
  394. # Frontend web application.
  395. web:
  396. image: langgenius/dify-web:0.11.0
  397. restart: always
  398. environment:
  399. # The base URL of console application api server, refers to the Console base URL of WEB service if console domain is
  400. # different from api or web app domain.
  401. # example: http://cloud.dify.ai
  402. CONSOLE_API_URL: ''
  403. # The URL for Web APP api server, refers to the Web App base URL of WEB service if web app domain is different from
  404. # console or api domain.
  405. # example: http://udify.app
  406. APP_API_URL: ''
  407. # The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
  408. SENTRY_DSN: ''
  409. # uncomment to expose dify-web port to host
  410. # ports:
  411. # - "3000:3000"
  412. # The postgres database.
  413. db:
  414. image: postgres:15-alpine
  415. restart: always
  416. environment:
  417. PGUSER: postgres
  418. # The password for the default postgres user.
  419. POSTGRES_PASSWORD: difyai123456
  420. # The name of the default postgres database.
  421. POSTGRES_DB: dify
  422. # postgres data directory
  423. PGDATA: /var/lib/postgresql/data/pgdata
  424. volumes:
  425. - ./volumes/db/data:/var/lib/postgresql/data
  426. # notice!: if you use windows-wsl2, postgres may not work properly due to the ntfs issue.you can use volumes to mount the data directory to the host.
  427. # if you use the following config, you need to uncomment the volumes configuration below at the end of the file.
  428. # - postgres:/var/lib/postgresql/data
  429. # uncomment to expose db(postgresql) port to host
  430. # ports:
  431. # - "5432:5432"
  432. healthcheck:
  433. test: [ "CMD", "pg_isready" ]
  434. interval: 1s
  435. timeout: 3s
  436. retries: 30
  437. # The redis cache.
  438. redis:
  439. image: redis:6-alpine
  440. restart: always
  441. volumes:
  442. # Mount the redis data directory to the container.
  443. - ./volumes/redis/data:/data
  444. # Set the redis password when startup redis server.
  445. command: redis-server --requirepass difyai123456
  446. healthcheck:
  447. test: [ "CMD", "redis-cli", "ping" ]
  448. # uncomment to expose redis port to host
  449. # ports:
  450. # - "6379:6379"
  451. # The Weaviate vector store.
  452. weaviate:
  453. image: semitechnologies/weaviate:1.19.0
  454. restart: always
  455. volumes:
  456. # Mount the Weaviate data directory to the container.
  457. - ./volumes/weaviate:/var/lib/weaviate
  458. environment:
  459. # The Weaviate configurations
  460. # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.
  461. QUERY_DEFAULTS_LIMIT: 25
  462. AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false'
  463. PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
  464. DEFAULT_VECTORIZER_MODULE: 'none'
  465. CLUSTER_HOSTNAME: 'node1'
  466. AUTHENTICATION_APIKEY_ENABLED: 'true'
  467. AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih'
  468. AUTHENTICATION_APIKEY_USERS: 'hello@dify.ai'
  469. AUTHORIZATION_ADMINLIST_ENABLED: 'true'
  470. AUTHORIZATION_ADMINLIST_USERS: 'hello@dify.ai'
  471. # uncomment to expose weaviate port to host
  472. # ports:
  473. # - "8080:8080"
  474. # The DifySandbox
  475. sandbox:
  476. image: langgenius/dify-sandbox:0.2.1
  477. restart: always
  478. environment:
  479. # The DifySandbox configurations
  480. # Make sure you are changing this key for your deployment with a strong key.
  481. # You can generate a strong key using `openssl rand -base64 42`.
  482. API_KEY: dify-sandbox
  483. GIN_MODE: 'release'
  484. WORKER_TIMEOUT: 15
  485. ENABLE_NETWORK: 'true'
  486. HTTP_PROXY: 'http://ssrf_proxy:3128'
  487. HTTPS_PROXY: 'http://ssrf_proxy:3128'
  488. SANDBOX_PORT: 8194
  489. volumes:
  490. - ./volumes/sandbox/dependencies:/dependencies
  491. networks:
  492. - ssrf_proxy_network
  493. # ssrf_proxy server
  494. # for more information, please refer to
  495. # https://docs.dify.ai/learn-more/faq/install-faq#id-18.-why-is-ssrf_proxy-needed
  496. ssrf_proxy:
  497. image: ubuntu/squid:latest
  498. restart: always
  499. volumes:
  500. # pls clearly modify the squid.conf file to fit your network environment.
  501. - ./volumes/ssrf_proxy/squid.conf:/etc/squid/squid.conf
  502. networks:
  503. - ssrf_proxy_network
  504. - default
  505. # Qdrant vector store.
  506. # uncomment to use qdrant as vector store.
  507. # (if uncommented, you need to comment out the weaviate service above,
  508. # and set VECTOR_STORE to qdrant in the api & worker service.)
  509. # qdrant:
  510. # image: langgenius/qdrant:v1.7.3
  511. # restart: always
  512. # volumes:
  513. # - ./volumes/qdrant:/qdrant/storage
  514. # environment:
  515. # QDRANT_API_KEY: 'difyai123456'
  516. # # uncomment to expose qdrant port to host
  517. # # ports:
  518. # # - "6333:6333"
  519. # # - "6334:6334"
  520. # The pgvector vector database.
  521. # Uncomment to use qdrant as vector store.
  522. # pgvector:
  523. # image: pgvector/pgvector:pg16
  524. # restart: always
  525. # environment:
  526. # PGUSER: postgres
  527. # # The password for the default postgres user.
  528. # POSTGRES_PASSWORD: difyai123456
  529. # # The name of the default postgres database.
  530. # POSTGRES_DB: dify
  531. # # postgres data directory
  532. # PGDATA: /var/lib/postgresql/data/pgdata
  533. # volumes:
  534. # - ./volumes/pgvector/data:/var/lib/postgresql/data
  535. # # uncomment to expose db(postgresql) port to host
  536. # # ports:
  537. # # - "5433:5432"
  538. # healthcheck:
  539. # test: [ "CMD", "pg_isready" ]
  540. # interval: 1s
  541. # timeout: 3s
  542. # retries: 30
  543. # The oracle vector database.
  544. # Uncomment to use oracle23ai as vector store. Also need to Uncomment volumes block
  545. # oracle:
  546. # image: container-registry.oracle.com/database/free:latest
  547. # restart: always
  548. # ports:
  549. # - 1521:1521
  550. # volumes:
  551. # - type: volume
  552. # source: oradata
  553. # target: /opt/oracle/oradata
  554. # - ./startupscripts:/opt/oracle/scripts/startup
  555. # environment:
  556. # - ORACLE_PWD=Dify123456
  557. # - ORACLE_CHARACTERSET=AL32UTF8
  558. # The nginx reverse proxy.
  559. # used for reverse proxying the API service and Web service.
  560. nginx:
  561. image: nginx:latest
  562. restart: always
  563. volumes:
  564. - ./nginx/nginx.conf:/etc/nginx/nginx.conf
  565. - ./nginx/proxy.conf:/etc/nginx/proxy.conf
  566. - ./nginx/conf.d:/etc/nginx/conf.d
  567. #- ./nginx/ssl:/etc/ssl
  568. depends_on:
  569. - api
  570. - web
  571. ports:
  572. - "80:80"
  573. #- "443:443"
  574. # notice: if you use windows-wsl2, postgres may not work properly due to the ntfs issue.you can use volumes to mount the data directory to the host.
  575. # volumes:
  576. #   postgres:
  577. networks:
  578. # create a network between sandbox, api and ssrf_proxy, and can not access outside.
  579. ssrf_proxy_network:
  580. driver: bridge
  581. internal: true
  582. #volumes:
  583. # oradata: