docker-compose.yaml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  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. # pgvector configurations
  333. PGVECTOR_HOST: pgvector
  334. PGVECTOR_PORT: 5432
  335. PGVECTOR_USER: postgres
  336. PGVECTOR_PASSWORD: difyai123456
  337. PGVECTOR_DATABASE: dify
  338. # tidb vector configurations
  339. TIDB_VECTOR_HOST: tidb
  340. TIDB_VECTOR_PORT: 4000
  341. TIDB_VECTOR_USER: xxx.root
  342. TIDB_VECTOR_PASSWORD: xxxxxx
  343. TIDB_VECTOR_DATABASE: dify
  344. # Chroma configuration
  345. CHROMA_HOST: 127.0.0.1
  346. CHROMA_PORT: 8000
  347. CHROMA_TENANT: default_tenant
  348. CHROMA_DATABASE: default_database
  349. CHROMA_AUTH_PROVIDER: chromadb.auth.token_authn.TokenAuthClientProvider
  350. CHROMA_AUTH_CREDENTIALS: xxxxxx
  351. # Notion import configuration, support public and internal
  352. NOTION_INTEGRATION_TYPE: public
  353. NOTION_CLIENT_SECRET: you-client-secret
  354. NOTION_CLIENT_ID: you-client-id
  355. NOTION_INTERNAL_SECRET: you-internal-secret
  356. # Indexing configuration
  357. INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH: 1000
  358. depends_on:
  359. - db
  360. - redis
  361. volumes:
  362. # Mount the storage directory to the container, for storing user files.
  363. - ./volumes/app/storage:/app/api/storage
  364. networks:
  365. - ssrf_proxy_network
  366. - default
  367. # Frontend web application.
  368. web:
  369. image: langgenius/dify-web:0.6.11
  370. restart: always
  371. environment:
  372. # The base URL of console application api server, refers to the Console base URL of WEB service if console domain is
  373. # different from api or web app domain.
  374. # example: http://cloud.dify.ai
  375. CONSOLE_API_URL: ''
  376. # The URL for Web APP api server, refers to the Web App base URL of WEB service if web app domain is different from
  377. # console or api domain.
  378. # example: http://udify.app
  379. APP_API_URL: ''
  380. # The DSN for Sentry error reporting. If not set, Sentry error reporting will be disabled.
  381. SENTRY_DSN: ''
  382. # uncomment to expose dify-web port to host
  383. # ports:
  384. # - "3000:3000"
  385. # The postgres database.
  386. db:
  387. image: postgres:15-alpine
  388. restart: always
  389. environment:
  390. PGUSER: postgres
  391. # The password for the default postgres user.
  392. POSTGRES_PASSWORD: difyai123456
  393. # The name of the default postgres database.
  394. POSTGRES_DB: dify
  395. # postgres data directory
  396. PGDATA: /var/lib/postgresql/data/pgdata
  397. volumes:
  398. - ./volumes/db/data:/var/lib/postgresql/data
  399. # 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.
  400. # if you use the following config, you need to uncomment the volumes configuration below at the end of the file.
  401. # - postgres:/var/lib/postgresql/data
  402. # uncomment to expose db(postgresql) port to host
  403. # ports:
  404. # - "5432:5432"
  405. healthcheck:
  406. test: [ "CMD", "pg_isready" ]
  407. interval: 1s
  408. timeout: 3s
  409. retries: 30
  410. # The redis cache.
  411. redis:
  412. image: redis:6-alpine
  413. restart: always
  414. volumes:
  415. # Mount the redis data directory to the container.
  416. - ./volumes/redis/data:/data
  417. # Set the redis password when startup redis server.
  418. command: redis-server --requirepass difyai123456
  419. healthcheck:
  420. test: [ "CMD", "redis-cli", "ping" ]
  421. # uncomment to expose redis port to host
  422. # ports:
  423. # - "6379:6379"
  424. # The Weaviate vector store.
  425. weaviate:
  426. image: semitechnologies/weaviate:1.19.0
  427. restart: always
  428. volumes:
  429. # Mount the Weaviate data directory to the container.
  430. - ./volumes/weaviate:/var/lib/weaviate
  431. environment:
  432. # The Weaviate configurations
  433. # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.
  434. QUERY_DEFAULTS_LIMIT: 25
  435. AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false'
  436. PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
  437. DEFAULT_VECTORIZER_MODULE: 'none'
  438. CLUSTER_HOSTNAME: 'node1'
  439. AUTHENTICATION_APIKEY_ENABLED: 'true'
  440. AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih'
  441. AUTHENTICATION_APIKEY_USERS: 'hello@dify.ai'
  442. AUTHORIZATION_ADMINLIST_ENABLED: 'true'
  443. AUTHORIZATION_ADMINLIST_USERS: 'hello@dify.ai'
  444. # uncomment to expose weaviate port to host
  445. # ports:
  446. # - "8080:8080"
  447. # The DifySandbox
  448. sandbox:
  449. image: langgenius/dify-sandbox:0.2.1
  450. restart: always
  451. environment:
  452. # The DifySandbox configurations
  453. # Make sure you are changing this key for your deployment with a strong key.
  454. # You can generate a strong key using `openssl rand -base64 42`.
  455. API_KEY: dify-sandbox
  456. GIN_MODE: 'release'
  457. WORKER_TIMEOUT: 15
  458. ENABLE_NETWORK: 'true'
  459. HTTP_PROXY: 'http://ssrf_proxy:3128'
  460. HTTPS_PROXY: 'http://ssrf_proxy:3128'
  461. SANDBOX_PORT: 8194
  462. volumes:
  463. - ./volumes/sandbox/dependencies:/dependencies
  464. networks:
  465. - ssrf_proxy_network
  466. # ssrf_proxy server
  467. # for more information, please refer to
  468. # https://docs.dify.ai/getting-started/install-self-hosted/install-faq#id-16.-why-is-ssrf_proxy-needed
  469. ssrf_proxy:
  470. image: ubuntu/squid:latest
  471. restart: always
  472. volumes:
  473. # pls clearly modify the squid.conf file to fit your network environment.
  474. - ./volumes/ssrf_proxy/squid.conf:/etc/squid/squid.conf
  475. networks:
  476. - ssrf_proxy_network
  477. - default
  478. # Qdrant vector store.
  479. # uncomment to use qdrant as vector store.
  480. # (if uncommented, you need to comment out the weaviate service above,
  481. # and set VECTOR_STORE to qdrant in the api & worker service.)
  482. # qdrant:
  483. # image: langgenius/qdrant:v1.7.3
  484. # restart: always
  485. # volumes:
  486. # - ./volumes/qdrant:/qdrant/storage
  487. # environment:
  488. # QDRANT_API_KEY: 'difyai123456'
  489. # # uncomment to expose qdrant port to host
  490. # # ports:
  491. # # - "6333:6333"
  492. # # - "6334:6334"
  493. # The pgvector vector database.
  494. # Uncomment to use qdrant as vector store.
  495. # pgvector:
  496. # image: pgvector/pgvector:pg16
  497. # restart: always
  498. # environment:
  499. # PGUSER: postgres
  500. # # The password for the default postgres user.
  501. # POSTGRES_PASSWORD: difyai123456
  502. # # The name of the default postgres database.
  503. # POSTGRES_DB: dify
  504. # # postgres data directory
  505. # PGDATA: /var/lib/postgresql/data/pgdata
  506. # volumes:
  507. # - ./volumes/pgvector/data:/var/lib/postgresql/data
  508. # # uncomment to expose db(postgresql) port to host
  509. # # ports:
  510. # # - "5433:5432"
  511. # healthcheck:
  512. # test: [ "CMD", "pg_isready" ]
  513. # interval: 1s
  514. # timeout: 3s
  515. # retries: 30
  516. # The nginx reverse proxy.
  517. # used for reverse proxying the API service and Web service.
  518. nginx:
  519. image: nginx:latest
  520. restart: always
  521. volumes:
  522. - ./nginx/nginx.conf:/etc/nginx/nginx.conf
  523. - ./nginx/proxy.conf:/etc/nginx/proxy.conf
  524. - ./nginx/conf.d:/etc/nginx/conf.d
  525. #- ./nginx/ssl:/etc/ssl
  526. depends_on:
  527. - api
  528. - web
  529. ports:
  530. - "80:80"
  531. #- "443:443"
  532. # 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.
  533. # volumes:
  534. #   postgres:
  535. networks:
  536. # create a network between sandbox, api and ssrf_proxy, and can not access outside.
  537. ssrf_proxy_network:
  538. driver: bridge
  539. internal: true