Skip to content

Conversation

@ACAne0320
Copy link
Contributor

Important

  1. Make sure you have read our contribution guidelines
  2. Ensure there is an associated issue and you have been assigned to it
  3. Use the correct syntax to link this PR: Fixes #<issue number>.

Summary

fixed #28540

Screenshots

Before After
... ...

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Copilot AI review requested due to automatic review settings November 22, 2025 12:27
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Nov 22, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ACAne0320, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the setup process for Dify's middleware services by integrating Docker Compose profile configuration directly into the middleware.env.example file. This change simplifies the docker compose up command, making it more user-friendly and less prone to errors by automatically loading the necessary profiles based on the environment variables defined.

Highlights

  • Simplified Docker Compose Profile Management: The COMPOSE_PROFILES variable has been added to middleware.env.example, allowing Docker Compose profiles to be configured directly within the environment file.
  • Updated Documentation for Middleware Startup: The docker/README.md file has been updated to reflect the new, streamlined method of starting middleware services, which now leverages the middleware.env file to automatically load profiles, eliminating the need for explicit --profile flags in the command.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copilot finished reviewing on behalf of ACAne0320 November 22, 2025 12:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the COMPOSE_PROFILES environment variable to the middleware.env.example file to enable automatic profile selection when running Docker Compose middleware services. This aligns the middleware development setup with the main .env.example configuration, which already includes this variable. The change allows developers to run middleware services without manually specifying --profile flags.

Key changes:

  • Added COMPOSE_PROFILES variable to middleware.env.example with dynamic value based on DB_TYPE
  • Updated README.md documentation to reflect the simplified Docker Compose command and explain automatic profile loading

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docker/middleware.env.example Added COMPOSE_PROFILES variable configuration section to enable automatic profile selection for database and vector store services
docker/README.md Updated middleware deployment instructions to remove manual --profile flag and document automatic COMPOSE_PROFILES loading

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the Docker deployment experience by simplifying the command to start middleware services. It introduces a COMPOSE_PROFILES variable in the middleware.env.example file, which allows Docker Compose to automatically select the correct profiles for the database and vector store. This removes the need for users to manually specify profiles on the command line. The changes are logical and well-implemented. I've only suggested a minor clarification in the README to ensure the documentation accurately reflects the new configuration.

- Navigate to the `docker` directory.
- Execute `docker compose -f docker-compose.middleware.yaml --profile weaviate -p dify up -d` to start the middleware services. (Change the profile to other vector database if you are not using weaviate)
- Execute `docker compose --env-file middleware.env -f docker-compose.middleware.yaml -p dify up -d` to start PostgreSQL/MySQL (per `DB_TYPE`) plus the bundled Weaviate instance.
> Compose automatically loads `COMPOSE_PROFILES=${DB_TYPE},weaviate` from `middleware.env`, so no extra `--profile` flags are needed. Adjust those variables if you want a different combo.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve clarity and prevent potential confusion for users, it would be best to make the explanation of the COMPOSE_PROFILES variable in this note consistent with its definition in the middleware.env.example file. The current note omits the default value for DB_TYPE.

Suggested change
> Compose automatically loads `COMPOSE_PROFILES=${DB_TYPE},weaviate` from `middleware.env`, so no extra `--profile` flags are needed. Adjust those variables if you want a different combo.
> Compose automatically loads `COMPOSE_PROFILES=${DB_TYPE:-postgresql},weaviate` from `middleware.env`, so no extra `--profile` flags are needed. Adjust variables in `middleware.env` if you want a different combination of services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When starting the middleware using middleware.env, the database container is not pulled.

1 participant