From b12057b7e5c726a8f7f0f1aa899db654382f9405 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AF=97=E6=B5=93?= <844670992@qq.com> Date: Mon, 24 Nov 2025 10:49:33 +0800 Subject: [PATCH] fix: add `COMPOSE_PROFILES` param to middleware.env.example file (#28541) Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- docker/README.md | 4 +++- docker/middleware.env.example | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index b5c46eb9fc..375570f106 100644 --- a/docker/README.md +++ b/docker/README.md @@ -40,7 +40,9 @@ Welcome to the new `docker` directory for deploying Dify using Docker Compose. T - Ensure the `middleware.env` file is created by running `cp middleware.env.example middleware.env` (refer to the `middleware.env.example` file). 1. **Running Middleware Services**: - 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:-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. ### Migration for Existing Users diff --git a/docker/middleware.env.example b/docker/middleware.env.example index 3374ddd537..dbfb75a8d6 100644 --- a/docker/middleware.env.example +++ b/docker/middleware.env.example @@ -134,6 +134,13 @@ WEAVIATE_AUTHORIZATION_ADMINLIST_ENABLED=true WEAVIATE_AUTHORIZATION_ADMINLIST_USERS=hello@dify.ai WEAVIATE_HOST_VOLUME=./volumes/weaviate +# ------------------------------ +# Docker Compose profile configuration +# ------------------------------ +# Loaded automatically when running `docker compose --env-file middleware.env ...`. +# Controls which DB/vector services start, so no extra `--profile` flag is needed. +COMPOSE_PROFILES=${DB_TYPE:-postgresql},weaviate + # ------------------------------ # Docker Compose Service Expose Host Port Configurations # ------------------------------