docker-compose.yaml 23 KB

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