docker-compose.middleware.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. services:
  2. # The postgres database.
  3. db:
  4. image: postgres:15-alpine
  5. restart: always
  6. environment:
  7. # The password for the default postgres user.
  8. POSTGRES_PASSWORD: difyai123456
  9. # The name of the default postgres database.
  10. POSTGRES_DB: dify
  11. # postgres data directory
  12. PGDATA: /var/lib/postgresql/data/pgdata
  13. volumes:
  14. - ./volumes/db/data:/var/lib/postgresql/data
  15. ports:
  16. - "5432:5432"
  17. # The redis cache.
  18. redis:
  19. image: redis:6-alpine
  20. restart: always
  21. volumes:
  22. # Mount the redis data directory to the container.
  23. - ./volumes/redis/data:/data
  24. # Set the redis password when startup redis server.
  25. command: redis-server --requirepass difyai123456
  26. ports:
  27. - "6379:6379"
  28. # The Weaviate vector store.
  29. weaviate:
  30. image: semitechnologies/weaviate:1.19.0
  31. restart: always
  32. volumes:
  33. # Mount the Weaviate data directory to the container.
  34. - ./volumes/weaviate:/var/lib/weaviate
  35. environment:
  36. # The Weaviate configurations
  37. # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.
  38. QUERY_DEFAULTS_LIMIT: 25
  39. AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'false'
  40. PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
  41. DEFAULT_VECTORIZER_MODULE: 'none'
  42. CLUSTER_HOSTNAME: 'node1'
  43. AUTHENTICATION_APIKEY_ENABLED: 'true'
  44. AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih'
  45. AUTHENTICATION_APIKEY_USERS: 'hello@dify.ai'
  46. AUTHORIZATION_ADMINLIST_ENABLED: 'true'
  47. AUTHORIZATION_ADMINLIST_USERS: 'hello@dify.ai'
  48. ports:
  49. - "8080:8080"
  50. # The DifySandbox
  51. sandbox:
  52. image: langgenius/dify-sandbox:0.2.1
  53. restart: always
  54. environment:
  55. # The DifySandbox configurations
  56. # Make sure you are changing this key for your deployment with a strong key.
  57. # You can generate a strong key using `openssl rand -base64 42`.
  58. API_KEY: dify-sandbox
  59. GIN_MODE: 'release'
  60. WORKER_TIMEOUT: 15
  61. ENABLE_NETWORK: 'true'
  62. HTTP_PROXY: 'http://ssrf_proxy:3128'
  63. HTTPS_PROXY: 'http://ssrf_proxy:3128'
  64. SANDBOX_PORT: 8194
  65. volumes:
  66. - ./volumes/sandbox/dependencies:/dependencies
  67. networks:
  68. - ssrf_proxy_network
  69. # ssrf_proxy server
  70. # for more information, please refer to
  71. # https://docs.dify.ai/getting-started/install-self-hosted/install-faq#id-16.-why-is-ssrf_proxy-needed
  72. ssrf_proxy:
  73. image: ubuntu/squid:latest
  74. restart: always
  75. ports:
  76. - "3128:3128"
  77. - "8194:8194"
  78. volumes:
  79. # pls clearly modify the squid.conf file to fit your network environment.
  80. - ./volumes/ssrf_proxy/squid.conf:/etc/squid/squid.conf
  81. networks:
  82. - ssrf_proxy_network
  83. - default
  84. # Qdrant vector store.
  85. # uncomment to use qdrant as vector store.
  86. # (if uncommented, you need to comment out the weaviate service above,
  87. # and set VECTOR_STORE to qdrant in the api & worker service.)
  88. # qdrant:
  89. # image: qdrant/qdrant:1.7.3
  90. # restart: always
  91. # volumes:
  92. # - ./volumes/qdrant:/qdrant/storage
  93. # environment:
  94. # QDRANT_API_KEY: 'difyai123456'
  95. # ports:
  96. # - "6333:6333"
  97. # - "6334:6334"
  98. networks:
  99. # create a network between sandbox, api and ssrf_proxy, and can not access outside.
  100. ssrf_proxy_network:
  101. driver: bridge
  102. internal: true