mirror of
https://github.com/langgenius/dify.git
synced 2026-05-15 13:02:19 -04:00
The 1677-line generated docker-compose.yaml was ~440 lines of YAML-anchor
boilerplate (`x-shared-env: &shared-api-worker-env` populated by
`generate_docker_compose` from `.env.example`). Native compose has had
`env_file:` for years and supports interpolation in env files since 2.24,
so the anchor + generator pair was reimplementing what compose does itself.
This commit:
- Removes the `x-shared-env: &shared-api-worker-env` anchor and all
`<<: *shared-api-worker-env` merges. Services that need the shared
config (`api`, `worker`, `worker_beat`, `plugin_daemon`) now use
env_file:
- .env.example
- .env
- Deletes `docker/docker-compose-template.yaml` (no longer needed; the
generated compose file becomes the single source of truth).
- Deletes `docker/generate_docker_compose` (no template, no generation).
`docker/docker-compose.yaml` now contains the full, hand-readable compose
config in 958 lines (was 1677 — a 43% reduction). The default
`docker compose up -d` brings up exactly the same set of services
(api/web/worker/redis/postgres/weaviate/...) via the existing
profile-gating in COMPOSE_PROFILES.
Suggestion from #35925.
Behavior note: shared-config keys are no longer interpolated through
compose, so passing `KEY=value docker compose up -d` from the shell
no longer overrides container env for those keys — set them in
`docker/.env` instead. Service-specific overrides via the
`environment:` block continue to work as before.
33 KiB
33 KiB