docker-compose.yaml 21 KB

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