Some changes from several PRs will be lost due to generate_docker_compose #7600

Closed
opened 2026-02-21 18:21:26 -05:00 by yindo · 4 comments
Owner

Originally created by @kurokobo on GitHub (Jan 8, 2025).

Originally assigned to: @laipz8200 on GitHub.

Self Checks

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

Dify version

N/A

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Checkout latest main branch
  2. Run generate_docker_compose in docker

✔️ Expected Behavior

No changes are made for docker-compose.yaml

Actual Behavior

diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
index 173a88bc4..70bf50db0 100644
--- a/docker/docker-compose.yaml
+++ b/docker/docker-compose.yaml
@@ -219,7 +219,7 @@ x-shared-env: &shared-api-worker-env
   TENCENT_VECTOR_DB_DATABASE: ${TENCENT_VECTOR_DB_DATABASE:-dify}
   TENCENT_VECTOR_DB_SHARD: ${TENCENT_VECTOR_DB_SHARD:-1}
   TENCENT_VECTOR_DB_REPLICAS: ${TENCENT_VECTOR_DB_REPLICAS:-2}
-  ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:-0.0.0.0}
+  ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:-elasticsearch}
   ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT:-9200}
   ELASTICSEARCH_USERNAME: ${ELASTICSEARCH_USERNAME:-elastic}
   ELASTICSEARCH_PASSWORD: ${ELASTICSEARCH_PASSWORD:-elastic}
@@ -800,7 +800,7 @@ services:
 
   milvus-standalone:
     container_name: milvus-standalone
-    image: milvusdb/milvus:v2.5.0-beta
+    image: milvusdb/milvus:v2.3.1
     profiles:
       - milvus
     command: [ 'milvus', 'run', 'standalone' ]
@@ -884,28 +884,20 @@ services:
     container_name: elasticsearch
     profiles:
       - elasticsearch
-      - elasticsearch-ja
     restart: always
     volumes:
-      - ./elasticsearch/docker-entrypoint.sh:/docker-entrypoint-mount.sh
       - dify_es01_data:/usr/share/elasticsearch/data
     environment:
       ELASTIC_PASSWORD: ${ELASTICSEARCH_PASSWORD:-elastic}
-      VECTOR_STORE: ${VECTOR_STORE:-}
       cluster.name: dify-es-cluster
       node.name: dify-es0
       discovery.type: single-node
-      xpack.license.self_generated.type: basic
+      xpack.license.self_generated.type: trial
       xpack.security.enabled: 'true'
       xpack.security.enrollment.enabled: 'false'
       xpack.security.http.ssl.enabled: 'false'
     ports:
       - ${ELASTICSEARCH_PORT:-9200}:9200
-    deploy:
-      resources:
-        limits:
-          memory: 2g
-    entrypoint: [ 'sh', '-c', "sh /docker-entrypoint-mount.sh" ]
     healthcheck:
       test: [ 'CMD', 'curl', '-s', 'http://localhost:9200/_cluster/health?pretty' ]
       interval: 30s

Additional Information

Some PRs are directly editing docker-compose.yaml without modifying docker-compose-template.yaml, and they have been approved and merged.

I think the template strategy was adopted to synchronize .env.example with docker-compose.yaml, but now docker-compose-template.yaml and docker-compose.yaml are not synchronized.

If we want to keep using the template strategy, I think it would be good to run generate_docker_compose in CI and trigger an error if there are additional differences in docker-compose.yaml.

Originally created by @kurokobo on GitHub (Jan 8, 2025). Originally assigned to: @laipz8200 on GitHub. ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version N/A ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Checkout latest main branch 2. Run `generate_docker_compose` in `docker` ### ✔️ Expected Behavior No changes are made for `docker-compose.yaml` ### ❌ Actual Behavior ```diff diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 173a88bc4..70bf50db0 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -219,7 +219,7 @@ x-shared-env: &shared-api-worker-env TENCENT_VECTOR_DB_DATABASE: ${TENCENT_VECTOR_DB_DATABASE:-dify} TENCENT_VECTOR_DB_SHARD: ${TENCENT_VECTOR_DB_SHARD:-1} TENCENT_VECTOR_DB_REPLICAS: ${TENCENT_VECTOR_DB_REPLICAS:-2} - ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:-0.0.0.0} + ELASTICSEARCH_HOST: ${ELASTICSEARCH_HOST:-elasticsearch} ELASTICSEARCH_PORT: ${ELASTICSEARCH_PORT:-9200} ELASTICSEARCH_USERNAME: ${ELASTICSEARCH_USERNAME:-elastic} ELASTICSEARCH_PASSWORD: ${ELASTICSEARCH_PASSWORD:-elastic} @@ -800,7 +800,7 @@ services: milvus-standalone: container_name: milvus-standalone - image: milvusdb/milvus:v2.5.0-beta + image: milvusdb/milvus:v2.3.1 profiles: - milvus command: [ 'milvus', 'run', 'standalone' ] @@ -884,28 +884,20 @@ services: container_name: elasticsearch profiles: - elasticsearch - - elasticsearch-ja restart: always volumes: - - ./elasticsearch/docker-entrypoint.sh:/docker-entrypoint-mount.sh - dify_es01_data:/usr/share/elasticsearch/data environment: ELASTIC_PASSWORD: ${ELASTICSEARCH_PASSWORD:-elastic} - VECTOR_STORE: ${VECTOR_STORE:-} cluster.name: dify-es-cluster node.name: dify-es0 discovery.type: single-node - xpack.license.self_generated.type: basic + xpack.license.self_generated.type: trial xpack.security.enabled: 'true' xpack.security.enrollment.enabled: 'false' xpack.security.http.ssl.enabled: 'false' ports: - ${ELASTICSEARCH_PORT:-9200}:9200 - deploy: - resources: - limits: - memory: 2g - entrypoint: [ 'sh', '-c', "sh /docker-entrypoint-mount.sh" ] healthcheck: test: [ 'CMD', 'curl', '-s', 'http://localhost:9200/_cluster/health?pretty' ] interval: 30s ``` ### Additional Information Some PRs are directly editing `docker-compose.yaml` without modifying `docker-compose-template.yaml`, and they have been approved and merged. - https://github.com/langgenius/dify/pull/11430 - https://github.com/langgenius/dify/pull/12194 I think the template strategy was adopted to synchronize `.env.example` with `docker-compose.yaml`, but now `docker-compose-template.yaml` and `docker-compose.yaml` are not synchronized. If we want to keep using the template strategy, I think it would be good to run `generate_docker_compose` in CI and trigger an error if there are additional differences in `docker-compose.yaml`.
yindo closed this issue 2026-02-21 18:21:26 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jan 8, 2025):

The issue you're encountering is due to direct modifications being made to docker-compose.yaml without corresponding updates to docker-compose-template.yaml. This leads to synchronization problems, as the generate-docker-compose script relies on the template to generate the docker-compose.yaml file consistently [1][2].

To address this, implementing an automated system that alerts contributors when they modify lines in docker-compose.yaml that are not environment variables could help maintain synchronization. This would ensure that any changes are also reflected in the docker-compose-template.yaml, preserving the integrity of the template strategy.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Jan 8, 2025): <!-- Answer --> The issue you're encountering is due to direct modifications being made to `docker-compose.yaml` without corresponding updates to `docker-compose-template.yaml`. This leads to synchronization problems, as the `generate-docker-compose` script relies on the template to generate the `docker-compose.yaml` file consistently <sup>[[1]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup><sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/generate_docker_compose)</sup>. To address this, implementing an automated system that alerts contributors when they modify lines in `docker-compose.yaml` that are not environment variables could help maintain synchronization. This would ensure that any changes are also reflected in the `docker-compose-template.yaml`, preserving the integrity of the template strategy. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/bff6a48f-fcbd-4098-b3dc-bd8feeac3533?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/bff6a48f-fcbd-4098-b3dc-bd8feeac3533?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/bff6a48f-fcbd-4098-b3dc-bd8feeac3533?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/bff6a48f-fcbd-4098-b3dc-bd8feeac3533?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/bff6a48f-fcbd-4098-b3dc-bd8feeac3533?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/bff6a48f-fcbd-4098-b3dc-bd8feeac3533?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Jan 8, 2025):

It is my bad, sorry for that. I forgot to check the template in this pr https://github.com/langgenius/dify/pull/12194 and #11430 was created before the generate_docker_compose.
As you mentioned, run this command in CI is a good idea.

@crazywoola commented on GitHub (Jan 8, 2025): It is my bad, sorry for that. I forgot to check the template in this pr https://github.com/langgenius/dify/pull/12194 and #11430 was created before the `generate_docker_compose`. As you mentioned, run this command in CI is a good idea.
Author
Owner

@fujita-h commented on GitHub (Jan 8, 2025):

@crazywoola @laipz8200
I created a PR #12509 that reverse-synced the docker-compose-template.yaml to match the current state.

@fujita-h commented on GitHub (Jan 8, 2025): @crazywoola @laipz8200 I created a PR #12509 that reverse-synced the docker-compose-template.yaml to match the current state.
Author
Owner

@kurokobo commented on GitHub (Jan 8, 2025):

@crazywoola @laipz8200
Sent PR to add CI test 😃 : https://github.com/langgenius/dify/pull/12514

@kurokobo commented on GitHub (Jan 8, 2025): @crazywoola @laipz8200 Sent PR to add CI test 😃 : https://github.com/langgenius/dify/pull/12514
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#7600