[PR #5339] chore: add .env.example and update docker-compose.yaml #24884

Closed
opened 2026-02-21 20:23:52 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/5339

State: closed
Merged: No


Description

  • Added .env.example file to provide a template for environment variable configuration.
  • Modified docker-compose.yaml to streamline configuration management by using environment variables.

Fixes #5249

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

How Has This Been Tested?

To verify the changes introduced in this pull request, the following tests were performed:

  1. Environment Variable Validation:

    • Description: The updated docker-compose.yaml now references environment variables from the new .env.example file. These environment variables were set with representative values in a local .env file to ensure that the Docker Compose services start up correctly and can access the necessary configuration.
    • Reproduction:
      1. Create a .env file in the same directory as docker-compose.yaml.
      2. Populate the .env file with the values for your environment variables (following the structure provided in .env.example).
      3. Run docker-compose up to start the services.
      4. Verify that the services start without errors and that the environment variables are correctly loaded by checking the logs or accessing the application.
  2. Configuration File Validation:

    • Description: The modified docker-compose.yaml file was manually reviewed to ensure that all environment variable references are correct and that the overall configuration structure aligns with the intended changes.
    • Reproduction:
      1. Examine the docker-compose.yaml file and verify that all environment variable placeholders (e.g., ${VARIABLE}) are replaced with the correct values from your .env file.
      2. Check that the structure of the configuration file (service definitions, volume mounts, etc.) is valid and makes sense for your setup.

Test Configuration:

  • Environment: Local development environment
  • Docker Compose Version: v2.15.1
  • Operating System: macOS Sonoma 14.5

Additional Notes:

  • Depending on the complexity of your application and its dependencies, you might need to conduct more thorough testing. This could include functional tests, integration tests, or performance tests.
  • If the changes involve external services (e.g., cloud storage, databases), ensure those services are available and configured correctly during testing.

Suggested Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods
  • optional I have made corresponding changes to the documentation
  • optional I have added tests that prove my fix is effective or that my feature works
  • optional New and existing unit tests pass locally with my changes
**Original Pull Request:** https://github.com/langgenius/dify/pull/5339 **State:** closed **Merged:** No --- # Description - Added .env.example file to provide a template for environment variable configuration. - Modified docker-compose.yaml to streamline configuration management by using environment variables. Fixes #5249 ## Type of Change Please delete options that are not relevant. - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [x] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement - [ ] Dependency upgrade # How Has This Been Tested? To verify the changes introduced in this pull request, the following tests were performed: 1. **Environment Variable Validation:** - **Description:** The updated `docker-compose.yaml` now references environment variables from the new `.env.example` file. These environment variables were set with representative values in a local `.env` file to ensure that the Docker Compose services start up correctly and can access the necessary configuration. - **Reproduction:** 1. Create a `.env` file in the same directory as `docker-compose.yaml`. 2. Populate the `.env` file with the values for your environment variables (following the structure provided in `.env.example`). 3. Run `docker-compose up` to start the services. 4. Verify that the services start without errors and that the environment variables are correctly loaded by checking the logs or accessing the application. 2. **Configuration File Validation:** - **Description:** The modified `docker-compose.yaml` file was manually reviewed to ensure that all environment variable references are correct and that the overall configuration structure aligns with the intended changes. - **Reproduction:** 1. Examine the `docker-compose.yaml` file and verify that all environment variable placeholders (e.g., `${VARIABLE}`) are replaced with the correct values from your `.env` file. 2. Check that the structure of the configuration file (service definitions, volume mounts, etc.) is valid and makes sense for your setup. **Test Configuration:** * **Environment:** Local development environment * **Docker Compose Version:** `v2.15.1` * **Operating System:** `macOS Sonoma 14.5` **Additional Notes:** * Depending on the complexity of your application and its dependencies, you might need to conduct more thorough testing. This could include functional tests, integration tests, or performance tests. * If the changes involve external services (e.g., cloud storage, databases), ensure those services are available and configured correctly during testing. # Suggested Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] My changes generate no new warnings - [ ] I ran `dev/reformat`(backend) and `cd web && npx lint-staged`(frontend) to appease the lint gods - [ ] `optional` I have made corresponding changes to the documentation - [ ] `optional` I have added tests that prove my fix is effective or that my feature works - [ ] `optional` New and existing unit tests pass locally with my changes
yindo added the pull-request label 2026-02-21 20:23:52 -05:00
yindo closed this issue 2026-02-21 20:23:52 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#24884