docker-compose.yaml 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  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. # 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. # Mail configuration, support: resend, smtp
  171. MAIL_TYPE: ''
  172. # default send from email address, if not specified
  173. MAIL_DEFAULT_SEND_FROM: 'YOUR EMAIL FROM (eg: no-reply <no-reply@dify.ai>)'
  174. SMTP_SERVER: ''
  175. SMTP_PORT: 465
  176. SMTP_USERNAME: ''
  177. SMTP_PASSWORD: ''
  178. SMTP_USE_TLS: 'true'
  179. SMTP_OPPORTUNISTIC_TLS: 'false'
  180. # the api-key for resend (https://resend.com)
  181. RESEND_API_KEY: ''
  182. RESEND_API_URL: https://api.resend.com
  183. # The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
  184. SENTRY_DSN: ''
  185. # The sample rate for Sentry events. Default: `1.0`
  186. SENTRY_TRACES_SAMPLE_RATE: 1.0
  187. # The sample rate for Sentry profiles. Default: `1.0`
  188. SENTRY_PROFILES_SAMPLE_RATE: 1.0
  189. # Notion import configuration, support public and internal
  190. NOTION_INTEGRATION_TYPE: public
  191. NOTION_CLIENT_SECRET: you-client-secret
  192. NOTION_CLIENT_ID: you-client-id
  193. NOTION_INTERNAL_SECRET: you-internal-secret
  194. # The sandbox service endpoint.
  195. CODE_EXECUTION_ENDPOINT: "http://sandbox:8194"
  196. CODE_EXECUTION_API_KEY: dify-sandbox
  197. CODE_MAX_NUMBER: 9223372036854775807
  198. CODE_MIN_NUMBER: -9223372036854775808
  199. CODE_MAX_STRING_LENGTH: 80000
  200. TEMPLATE_TRANSFORM_MAX_LENGTH: 80000
  201. CODE_MAX_STRING_ARRAY_LENGTH: 30
  202. CODE_MAX_OBJECT_ARRAY_LENGTH: 30
  203. CODE_MAX_NUMBER_ARRAY_LENGTH: 1000
  204. # SSRF Proxy server
  205. SSRF_PROXY_HTTP_URL: 'http://ssrf_proxy:3128'
  206. SSRF_PROXY_HTTPS_URL: 'http://ssrf_proxy:3128'
  207. # Indexing configuration
  208. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
  209. depends_on:
  210. - db
  211. - redis
  212. volumes:
  213. # Mount the storage directory to the container, for storing user files.
  214. - ./volumes/app/storage:/app/api/storage
  215. # uncomment to expose dify-api port to host
  216. # ports:
  217. # - "5001:5001"
  218. networks:
  219. - ssrf_proxy_network
  220. - default
  221. # worker service
  222. # The Celery worker for processing the queue.
  223. worker:
  224. image: langgenius/dify-api:0.6.11
  225. restart: always
  226. environment:
  227. CONSOLE_WEB_URL: ''
  228. # Startup mode, 'worker' starts the Celery worker for processing the queue.
  229. MODE: worker
  230. # --- All the configurations below are the same as those in the 'api' service. ---
  231. # The log level for the application. Supported values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`
  232. LOG_LEVEL: INFO
  233. # 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`.
  234. # same as the API service
  235. SECRET_KEY: sk-9f73s3ljTXVcMT3Blb3ljTqtsKiGHXVcMT3BlbkFJLK7U
  236. # The configurations of postgres database connection.
  237. # It is consistent with the configuration in the 'db' service below.
  238. DB_USERNAME: postgres
  239. DB_PASSWORD: difyai123456
  240. DB_HOST: db
  241. DB_PORT: 5432
  242. DB_DATABASE: dify
  243. # The configurations of redis cache connection.
  244. REDIS_HOST: redis
  245. REDIS_PORT: 6379
  246. REDIS_USERNAME: ''
  247. REDIS_PASSWORD: difyai123456
  248. REDIS_DB: 0
  249. REDIS_USE_SSL: 'false'
  250. # The configurations of celery broker.
  251. CELERY_BROKER_URL: redis://:difyai123456@redis:6379/1
  252. # The type of storage to use for storing user files. Supported values are `local` and `s3` and `azure-blob` and `google-storage`, Default: `local`
  253. STORAGE_TYPE: local
  254. STORAGE_LOCAL_PATH: storage
  255. # The S3 storage configurations, only available when STORAGE_TYPE is `s3`.
  256. S3_USE_AWS_MANAGED_IAM: 'false'
  257. S3_ENDPOINT: 'https://xxx.r2.cloudflarestorage.com'
  258. S3_BUCKET_NAME: 'difyai'
  259. S3_ACCESS_KEY: 'ak-difyai'
  260. S3_SECRET_KEY: 'sk-difyai'
  261. S3_REGION: 'us-east-1'
  262. # The Azure Blob storage configurations, only available when STORAGE_TYPE is `azure-blob`.
  263. AZURE_BLOB_ACCOUNT_NAME: 'difyai'
  264. AZURE_BLOB_ACCOUNT_KEY: 'difyai'
  265. AZURE_BLOB_CONTAINER_NAME: 'difyai-container'
  266. AZURE_BLOB_ACCOUNT_URL: 'https://<your_account_name>.blob.core.windows.net'
  267. # The Google storage configurations, only available when STORAGE_TYPE is `google-storage`.
  268. GOOGLE_STORAGE_BUCKET_NAME: 'yout-bucket-name'
  269. # if you want to use Application Default Credentials, you can leave GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64 empty.
  270. GOOGLE_STORAGE_SERVICE_ACCOUNT_JSON_BASE64: 'your-google-service-account-json-base64-string'
  271. # The Alibaba Cloud OSS configurations, only available when STORAGE_TYPE is `aliyun-oss`
  272. ALIYUN_OSS_BUCKET_NAME: 'your-bucket-name'
  273. ALIYUN_OSS_ACCESS_KEY: 'your-access-key'
  274. ALIYUN_OSS_SECRET_KEY: 'your-secret-key'
  275. ALIYUN_OSS_ENDPOINT: 'https://oss-ap-southeast-1-internal.aliyuncs.com'
  276. ALIYUN_OSS_REGION: 'ap-southeast-1'
  277. ALIYUN_OSS_AUTH_VERSION: 'v4'
  278. # The Tencent COS storage configurations, only available when STORAGE_TYPE is `tencent-cos`.
  279. TENCENT_COS_BUCKET_NAME: 'your-bucket-name'
  280. TENCENT_COS_SECRET_KEY: 'your-secret-key'
  281. TENCENT_COS_SECRET_ID: 'your-secret-id'
  282. TENCENT_COS_REGION: 'your-region'
  283. TENCENT_COS_SCHEME: 'your-scheme'
  284. # The type of vector store to use. Supported values are `weaviate`, `qdrant`, `milvus`, `relyt`, `pgvector`.
  285. VECTOR_STORE: weaviate
  286. # The Weaviate endpoint URL. Only available when VECTOR_STORE is `weaviate`.
  287. WEAVIATE_ENDPOINT: http://weaviate:8080
  288. # The Weaviate API key.
  289. WEAVIATE_API_KEY: WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih
  290. # The Qdrant endpoint URL. Only available when VECTOR_STORE is `qdrant`.
  291. QDRANT_URL: http://qdrant:6333
  292. # The Qdrant API key.
  293. QDRANT_API_KEY: difyai123456
  294. # The Qdrant client timeout setting.
  295. QDRANT_CLIENT_TIMEOUT: 20
  296. # The Qdrant client enable gRPC mode.
  297. QDRANT_GRPC_ENABLED: 'false'
  298. # The Qdrant server gRPC mode PORT.
  299. QDRANT_GRPC_PORT: 6334
  300. # Milvus configuration Only available when VECTOR_STORE is `milvus`.
  301. # The milvus host.
  302. MILVUS_HOST: 127.0.0.1
  303. # The milvus host.
  304. MILVUS_PORT: 19530
  305. # The milvus username.
  306. MILVUS_USER: root
  307. # The milvus password.
  308. MILVUS_PASSWORD: Milvus
  309. # The milvus tls switch.
  310. MILVUS_SECURE: 'false'
  311. # Mail configuration, support: resend
  312. MAIL_TYPE: ''
  313. # default send from email address, if not specified
  314. MAIL_DEFAULT_SEND_FROM: 'YOUR EMAIL FROM (eg: no-reply <no-reply@dify.ai>)'
  315. SMTP_SERVER: ''
  316. SMTP_PORT: 465
  317. SMTP_USERNAME: ''
  318. SMTP_PASSWORD: ''
  319. SMTP_USE_TLS: 'true'
  320. SMTP_OPPORTUNISTIC_TLS: 'false'
  321. # the api-key for resend (https://resend.com)
  322. RESEND_API_KEY: ''
  323. RESEND_API_URL: https://api.resend.com
  324. # relyt configurations
  325. RELYT_HOST: db
  326. RELYT_PORT: 5432
  327. RELYT_USER: postgres
  328. RELYT_PASSWORD: difyai123456
  329. RELYT_DATABASE: postgres
  330. # tencent configurations
  331. TENCENT_VECTOR_DB_URL: http://127.0.0.1
  332. TENCENT_VECTOR_DB_API_KEY: dify
  333. TENCENT_VECTOR_DB_TIMEOUT: 30
  334. TENCENT_VECTOR_DB_USERNAME: dify
  335. TENCENT_VECTOR_DB_DATABASE: dify
  336. TENCENT_VECTOR_DB_SHARD: 1
  337. TENCENT_VECTOR_DB_REPLICAS: 2
  338. # OpenSearch configuration
  339. OPENSEARCH_HOST: 127.0.0.1
  340. OPENSEARCH_PORT: 9200
  341. OPENSEARCH_USER: admin
  342. OPENSEARCH_PASSWORD: admin
  343. OPENSEARCH_SECURE: 'true'
  344. # pgvector configurations
  345. PGVECTOR_HOST: pgvector
  346. PGVECTOR_PORT: 5432
  347. PGVECTOR_USER: postgres
  348. PGVECTOR_PASSWORD: difyai123456
  349. PGVECTOR_DATABASE: dify
  350. # tidb vector configurations
  351. TIDB_VECTOR_HOST: tidb
  352. TIDB_VECTOR_PORT: 4000
  353. TIDB_VECTOR_USER: xxx.root
  354. TIDB_VECTOR_PASSWORD: xxxxxx
  355. TIDB_VECTOR_DATABASE: dify
  356. # oracle configurations
  357. ORACLE_HOST: oracle
  358. ORACLE_PORT: 1521
  359. ORACLE_USER: dify
  360. ORACLE_PASSWORD: dify
  361. ORACLE_DATABASE: FREEPDB1
  362. # Chroma configuration
  363. CHROMA_HOST: 127.0.0.1
  364. CHROMA_PORT: 8000
  365. CHROMA_TENANT: default_tenant
  366. CHROMA_DATABASE: default_database
  367. CHROMA_AUTH_PROVIDER: chromadb.auth.token_authn.TokenAuthClientProvider
  368. CHROMA_AUTH_CREDENTIALS: xxxxxx
  369. # Notion import configuration, support public and internal
  370. NOTION_INTEGRATION_TYPE: public
  371. NOTION_CLIENT_SECRET: you-client-secret
  372. NOTION_CLIENT_ID: you-client-id
  373. NOTION_INTERNAL_SECRET: you-internal-secret
  374. # Indexing configuration
  375. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
  376. depends_on:
  377. - db
  378. - redis
  379. volumes:
  380. # Mount the storage directory to the container, for storing user files.
  381. - ./volumes/app/storage:/app/api/storage
  382. networks:
  383. - ssrf_proxy_network
  384. - default
  385. # Frontend web application.
  386. web:
  387. image: langgenius/dify-web:0.6.11
  388. restart: always
  389. environment:
  390. # The base URL of console application api server, refers to the Console base URL of WEB service if console domain is
  391. # different from api or web app domain.
  392. # example: http://cloud.dify.ai
  393. CONSOLE_API_URL: ''
  394. # The URL for Web APP api server, refers to the Web App base URL of WEB service if web app domain is different from
  395. # console or api domain.
  396. # example: http://udify.app
  397. APP_API_URL: ''
  398. # The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
  399. SENTRY_DSN: ''
  400. # uncomment to expose dify-web port to host
  401. # ports:
  402. # - "3000:3000"
  403. # The postgres database.
  404. db:
  405. image: postgres:15-alpine
  406. restart: always
  407. environment:
  408. PGUSER: postgres
  409. # The password for the default postgres user.
  410. POSTGRES_PASSWORD: difyai123456
  411. # The name of the default postgres database.
  412. POSTGRES_DB: dify
  413. # postgres data directory
  414. PGDATA: /var/lib/postgresql/data/pgdata
  415. volumes:
  416. - ./volumes/db/data:/var/lib/postgresql/data
  417. # 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.
  418. # if you use the following config, you need to uncomment the volumes configuration below at the end of the file.
  419. # - postgres:/var/lib/postgresql/data
  420. # uncomment to expose db(postgresql) port to host
  421. # ports:
  422. # - "5432:5432"
  423. healthcheck:
  424. test: [ "CMD", "pg_isready" ]
  425. interval: 1s
  426. timeout: 3s
  427. retries: 30
  428. # The redis cache.
  429. redis:
  430. image: redis:6-alpine
  431. restart: always
  432. volumes:
  433. # Mount the redis data directory to the container.
  434. - ./volumes/redis/data:/data
  435. # Set the redis password when startup redis server.
  436. command: redis-server --requirepass difyai123456
  437. healthcheck:
  438. test: [ "CMD", "redis-cli", "ping" ]
  439. # uncomment to expose redis port to host
  440. # ports:
  441. # - "6379:6379"
  442. # The Weaviate vector store.
  443. weaviate:
  444. image: semitechnologies/weaviate:1.19.0
  445. restart: always
  446. volumes:
  447. # Mount the Weaviate data directory to the container.
  448. - ./volumes/weaviate:/var/lib/weaviate
  449. environment:
  450. # The Weaviate configurations
  451. # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.
  452. QUERY_DEFAULTS_LIMIT: 25
  453. AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false'
  454. PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
  455. DEFAULT_VECTORIZER_MODULE: 'none'
  456. CLUSTER_HOSTNAME: 'node1'
  457. AUTHENTICATION_APIKEY_ENABLED: 'true'
  458. AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih'
  459. AUTHENTICATION_APIKEY_USERS: 'hello@dify.ai'
  460. AUTHORIZATION_ADMINLIST_ENABLED: 'true'
  461. AUTHORIZATION_ADMINLIST_USERS: 'hello@dify.ai'
  462. # uncomment to expose weaviate port to host
  463. # ports:
  464. # - "8080:8080"
  465. # The DifySandbox
  466. sandbox:
  467. image: langgenius/dify-sandbox:0.2.1
  468. restart: always
  469. environment:
  470. # The DifySandbox configurations
  471. # Make sure you are changing this key for your deployment with a strong key.
  472. # You can generate a strong key using `openssl rand -base64 42`.
  473. API_KEY: dify-sandbox
  474. GIN_MODE: 'release'
  475. WORKER_TIMEOUT: 15
  476. ENABLE_NETWORK: 'true'
  477. HTTP_PROXY: 'http://ssrf_proxy:3128'
  478. HTTPS_PROXY: 'http://ssrf_proxy:3128'
  479. SANDBOX_PORT: 8194
  480. volumes:
  481. - ./volumes/sandbox/dependencies:/dependencies
  482. networks:
  483. - ssrf_proxy_network
  484. # ssrf_proxy server
  485. # for more information, please refer to
  486. # https://docs.dify.ai/getting-started/install-self-hosted/install-faq#id-16.-why-is-ssrf_proxy-needed
  487. ssrf_proxy:
  488. image: ubuntu/squid:latest
  489. restart: always
  490. volumes:
  491. # pls clearly modify the squid.conf file to fit your network environment.
  492. - ./volumes/ssrf_proxy/squid.conf:/etc/squid/squid.conf
  493. networks:
  494. - ssrf_proxy_network
  495. - default
  496. # Qdrant vector store.
  497. # uncomment to use qdrant as vector store.
  498. # (if uncommented, you need to comment out the weaviate service above,
  499. # and set VECTOR_STORE to qdrant in the api & worker service.)
  500. # qdrant:
  501. # image: langgenius/qdrant:v1.7.3
  502. # restart: always
  503. # volumes:
  504. # - ./volumes/qdrant:/qdrant/storage
  505. # environment:
  506. # QDRANT_API_KEY: 'difyai123456'
  507. # # uncomment to expose qdrant port to host
  508. # # ports:
  509. # # - "6333:6333"
  510. # # - "6334:6334"
  511. # The pgvector vector database.
  512. # Uncomment to use qdrant as vector store.
  513. # pgvector:
  514. # image: pgvector/pgvector:pg16
  515. # restart: always
  516. # environment:
  517. # PGUSER: postgres
  518. # # The password for the default postgres user.
  519. # POSTGRES_PASSWORD: difyai123456
  520. # # The name of the default postgres database.
  521. # POSTGRES_DB: dify
  522. # # postgres data directory
  523. # PGDATA: /var/lib/postgresql/data/pgdata
  524. # volumes:
  525. # - ./volumes/pgvector/data:/var/lib/postgresql/data
  526. # # uncomment to expose db(postgresql) port to host
  527. # # ports:
  528. # # - "5433:5432"
  529. # healthcheck:
  530. # test: [ "CMD", "pg_isready" ]
  531. # interval: 1s
  532. # timeout: 3s
  533. # retries: 30
  534. # The oracle vector database.
  535. # Uncomment to use oracle23ai as vector store. Also need to Uncomment volumes block
  536. # oracle:
  537. # image: container-registry.oracle.com/database/free:latest
  538. # restart: always
  539. # ports:
  540. # - 1521:1521
  541. # volumes:
  542. # - type: volume
  543. # source: oradata
  544. # target: /opt/oracle/oradata
  545. # - ./startupscripts:/opt/oracle/scripts/startup
  546. # environment:
  547. # - ORACLE_PWD=Dify123456
  548. # - ORACLE_CHARACTERSET=AL32UTF8
  549. # The nginx reverse proxy.
  550. # used for reverse proxying the API service and Web service.
  551. nginx:
  552. image: nginx:latest
  553. restart: always
  554. volumes:
  555. - ./nginx/nginx.conf:/etc/nginx/nginx.conf
  556. - ./nginx/proxy.conf:/etc/nginx/proxy.conf
  557. - ./nginx/conf.d:/etc/nginx/conf.d
  558. #- ./nginx/ssl:/etc/ssl
  559. depends_on:
  560. - api
  561. - web
  562. ports:
  563. - "80:80"
  564. #- "443:443"
  565. # 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.
  566. # volumes:
  567. #   postgres:
  568. networks:
  569. # create a network between sandbox, api and ssrf_proxy, and can not access outside.
  570. ssrf_proxy_network:
  571. driver: bridge
  572. internal: true
  573. #volumes:
  574. # oradata: