docker-compose.middleware.yaml 3.4 KB

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