-
Notifications
You must be signed in to change notification settings - Fork 18.5k
fix: add COMPOSE_PROFILES param to middleware.env.example file
#28541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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 Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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_PROFILESvariable tomiddleware.env.examplewith dynamic value based onDB_TYPE - Updated
README.mddocumentation 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.
There was a problem hiding this 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| > 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. |
Important
Fixes #<issue number>.Summary
fixed #28540
Screenshots
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods