docker-compose.yaml 22 KB

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