dify icon indicating copy to clipboard operation
dify copied to clipboard

When using Docker Compose to start, the sandbox configuration file isn't loaded from the volume by default.

Open auxpd opened this issue 11 months ago • 4 comments

Self Checks

  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Start the dify project with docker-compose

✔️ Expected Behavior

The sandbox configuration file of the volume can take effect

❌ Actual Behavior

It does not take effect because the volumes are not loaded into compose file

auxpd avatar Feb 13 '25 02:02 auxpd

To ensure that the sandbox configuration file is loaded from the volume when using Docker Compose to start the Dify project, you need to correctly mount the volume in your docker-compose file. According to the docker-compose-template.yaml, the sandbox service should have the volumes configured as follows:

sandbox:
  image: langgenius/dify-sandbox:0.2.10
  restart: always
  environment:
    # The DifySandbox configurations
    API_KEY: ${SANDBOX_API_KEY:-dify-sandbox}
    GIN_MODE: ${SANDBOX_GIN_MODE:-release}
    WORKER_TIMEOUT: ${SANDBOX_WORKER_TIMEOUT:-15}
    ENABLE_NETWORK: ${SANDBOX_ENABLE_NETWORK:-true}
    HTTP_PROXY: ${SANDBOX_HTTP_PROXY:-http://ssrf_proxy:3128}
    HTTPS_PROXY: ${SANDBOX_HTTPS_PROXY:-http://ssrf_proxy:3128}
    SANDBOX_PORT: ${SANDBOX_PORT:-8194}
  volumes:
    - ./volumes/sandbox/dependencies:/dependencies
  healthcheck:
    test: [ 'CMD', 'curl', '-f', 'http://localhost:8194/health' ]
  networks:
    - ssrf_proxy_network

Ensure that the ./volumes/sandbox/dependencies directory on your host machine contains the necessary configuration files for the sandbox. This directory is mounted to /dependencies inside the sandbox container, allowing the sandbox to access and load the configuration files from this volume [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

dosubot[bot] avatar Feb 13 '25 02:02 dosubot[bot]

What configuration file you are trying to get here? The description here is too simple to investigate.

crazywoola avatar Feb 13 '25 02:02 crazywoola

The default docker-compose does not mount the configuration file on the volume of the sandbox, and I pasted the specific code to RP sandbox: volumes: - ./volumes/sandbox/dependencies:/dependencies - ./volumes/sandbox/conf:/conf

auxpd avatar Feb 13 '25 02:02 auxpd

@auxpd Please open a PR based on our latest branch, we have already removed docker-legacy.

crazywoola avatar Feb 25 '25 09:02 crazywoola