docker-compose.yaml 24 KB

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