Back Home

GitHub Repo

Dify Merges Docker Configuration Fix for Service Environment Variable Overrides

On November 3, Dify merged a deployment configuration fix addressing ignored environment files and missing connection defaults in the plugin daemon. The change requires Docker Compose 2.35.0 or later and is now on the main branch; inclusion in a release still needs to be confirmed.

The original uploader was Ggia at Greek Wikipedia. · CC BY-SA 2.5 · Image source
zh-Hant

On November 3, Dify merged a Docker environment variable fix into the main branch, addressing a gap in self-hosted deployments where “editing the configuration file leaves the containers using default values.” The issue was reported the previous day and reproduced on the main branch with the default 1.18.0 image, so it should not be assumed that all existing versions are affected. Issue report

Specific examples in the report include setting the nginx upload limit to 200M while it remained at 100M, and setting the sandbox execution timeout to 120 seconds while WORKER_TIMEOUT inside the container remained at 15 seconds. The plugin daemon also failed to load shared settings, leaving out expected database and Redis connection values. For workflow operations, these discrepancies can cause file uploads and code execution to fail at the wrong thresholds, and may lead teams to misdiagnose the issue as a limitation in the application itself. Reproduction steps and results

The technical issue is that Compose variable interpolation and loading a container’s environment happen at different stages. Docker’s documentation specifies that Compose environment settings take precedence over env_file; if the former has already resolved to a default value, a custom value in the service’s env file cannot override it. Simply adding an environment file does not guarantee that the container will receive the values entered by the operator. Docker precedence documentation

The fix changes the bundled service templates to .defaults, allowing optional override values to participate in container variable mapping, and restores shared connection defaults for the plugin daemon. The existing service .env paths remain in place, and the root .env retains higher priority. Compose-level inputs such as ports and mount paths must still be placed in the root configuration file. Fix details

Using the new configuration requires Docker Compose 2.35.0 or later. Unexpected empty values in older files must also be cleaned up manually; local settings are not rewritten automatically. Engineering teams should first check the resolved configuration with docker compose config, then confirm whether their target release includes the fix. As of this check, the latest release page still lists version 1.18.0; a merge to the main branch does not mean existing images already contain the fix. Compatibility requirements, release page

Sources

  1. Docker service env overrides are ignored and plugin daemon misses connection defaults
  2. fix(docker): honor categorized service environment overrides #45359
  3. Environment variables precedence in Docker Compose
  4. Dify releases