docker-compose.middleware.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. services:
  2. # The postgres database.
  3. db:
  4. image: postgres:15-alpine
  5. restart: always
  6. env_file:
  7. - ./middleware.env
  8. environment:
  9. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-difyai123456}
  10. POSTGRES_DB: ${POSTGRES_DB:-dify}
  11. PGDATA: ${PGDATA:-/var/lib/postgresql/data/pgdata}
  12. volumes:
  13. - ./volumes/db/data:/var/lib/postgresql/data
  14. ports:
  15. - "5432:5432"
  16. # The redis cache.
  17. redis:
  18. image: redis:6-alpine
  19. restart: always
  20. volumes:
  21. # Mount the redis data directory to the container.
  22. - ./volumes/redis/data:/data
  23. # Set the redis password when startup redis server.
  24. command: redis-server --requirepass difyai123456
  25. ports:
  26. - "6379:6379"
  27. # The Weaviate vector store.
  28. weaviate:
  29. image: semitechnologies/weaviate:1.19.0
  30. restart: always
  31. volumes:
  32. # Mount the Weaviate data directory to the container.
  33. - ./volumes/weaviate:/var/lib/weaviate
  34. env_file:
  35. - ./middleware.env
  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. PERSISTENCE_DATA_PATH: ${PERSISTENCE_DATA_PATH:-'/var/lib/weaviate'}
  40. QUERY_DEFAULTS_LIMIT: ${QUERY_DEFAULTS_LIMIT:-25}
  41. AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: ${AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED:-false}
  42. DEFAULT_VECTORIZER_MODULE: ${DEFAULT_VECTORIZER_MODULE:-none}
  43. CLUSTER_HOSTNAME: ${CLUSTER_HOSTNAME:-node1}
  44. AUTHENTICATION_APIKEY_ENABLED: ${AUTHENTICATION_APIKEY_ENABLED:-true}
  45. AUTHENTICATION_APIKEY_ALLOWED_KEYS: ${AUTHENTICATION_APIKEY_ALLOWED_KEYS:-WVF5YThaHlkYwhGUSmCRgsX3tD5ngdN8pkih}
  46. AUTHENTICATION_APIKEY_USERS: ${AUTHENTICATION_APIKEY_USERS:-hello@dify.ai}
  47. AUTHORIZATION_ADMINLIST_ENABLED: ${AUTHORIZATION_ADMINLIST_ENABLED:-true}
  48. AUTHORIZATION_ADMINLIST_USERS: ${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: ${API_KEY:-dify-sandbox}
  60. GIN_MODE: ${GIN_MODE:-release}
  61. WORKER_TIMEOUT: ${WORKER_TIMEOUT:-15}
  62. ENABLE_NETWORK: ${ENABLE_NETWORK:-true}
  63. HTTP_PROXY: ${HTTP_PROXY:-http://ssrf_proxy:3128}
  64. HTTPS_PROXY: ${HTTPS_PROXY:-http://ssrf_proxy:3128}
  65. SANDBOX_PORT: ${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. volumes:
  77. - ./ssrf_proxy/squid.conf.template:/etc/squid/squid.conf.template
  78. - ./ssrf_proxy/docker-entrypoint.sh:/docker-entrypoint.sh
  79. entrypoint: /docker-entrypoint.sh
  80. ports:
  81. - "3128:3128"
  82. - "8194:8194"
  83. environment:
  84. # pls clearly modify the squid env vars to fit your network environment.
  85. HTTP_PORT: ${HTTP_PORT:-3128}
  86. COREDUMP_DIR: ${COREDUMP_DIR:-/var/spool/squid}
  87. REVERSE_PROXY_PORT: ${REVERSE_PROXY_PORT:-8194}
  88. SANDBOX_HOST: ${SANDBOX_HOST:-sandbox}
  89. SANDBOX_PORT: ${SANDBOX_PORT:-8194}
  90. networks:
  91. - ssrf_proxy_network
  92. - default
  93. networks:
  94. # create a network between sandbox, api and ssrf_proxy, and can not access outside.
  95. ssrf_proxy_network:
  96. driver: bridge
  97. internal: true