docs/modify docker compose (#721)

* Update postgresql content

* Docs: update docker api faq

* Update faqs.md

---------

Co-authored-by: Hanqing Zhao <sherry9277@gmail.com>
This commit is contained in:
AllenWriter
2025-04-15 14:07:39 +08:00
committed by GitHub
parent 5f3c48e482
commit 5cc8af50c3
5 changed files with 55 additions and 27 deletions
+17 -5
View File
@@ -11,11 +11,11 @@ docker compose down
docker compose up -d
```
If you still haven't received the email, please check if the email service is working properly and whether the email has been placed in the trash list.
If you still haven't received the email, please check if the email service is working properly and whether the email has been placed in the spam folder.
### 2. How to handle if the workflow is too complex and exceeds the node limit?
In the community edition, you can manually adjust the MAX\_TREE\_DEPTH limit for single branch depth in `web/app/components/workflow/constants.ts.` Our default value is 50, and it's important to note that excessively deep branches may affect performance in self-hosted scenarios.
In the community edition, you can manually adjust the MAX\_TREE\_DEPTH limit for single branch depth in `web/app/components/workflow/constants.ts`. Our default value is 50, and it's important to note that excessively deep branches may affect performance in self-hosted scenarios.
### 3. How to specify the runtime for each workflow node?
@@ -31,7 +31,7 @@ docker exec -it docker-api-1 flask reset-password
It will prompt you to enter the email address and the new password. Example:
```
```bash
dify@my-pc:~/hello/dify/docker$ docker compose up -d
[+] Running 9/9
✔ Container docker-web-1 Started 0.1s
@@ -59,10 +59,22 @@ If you're using Docker Compose, you can customize the access port by modifying t
You need to modify the Nginx configuration:
```json
```docker
EXPOSE_NGINX_PORT=80
EXPOSE_NGINX_SSL_PORT=443
```
### 6. How to resolve database connection errors in docker-api-1?
Other self-host issue please check this document [Self-Host Related](../../learn-more/faq/install-faq.md)。
**Issue Details**: When accessing `http://localhost`, you may encounter an `Internal Server Error`; and the following message might appear in the `docker-api-1` logs:
```bash
FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption
```
**Solution**: Update the `/var/lib/postgresql/pgdata/pg_hba.conf` file inside the db container to allow connections from the network segment mentioned in the error message. For example:
```bash
docker exec -it docker-db-1 sh -c "echo 'host all all 172.19.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf"
docker-compose restart
```
+1 -1
View File
@@ -12,7 +12,7 @@
* [aaPanelでのデプロイ方法](getting-started/install-self-hosted/bt-panel.md)
* [フロントエンドDockerコンテナを単独起動](getting-started/install-self-hosted/start-the-frontend-docker-container.md)
* [環境変数の説明](getting-started/install-self-hosted/environments.md)
* [よくある質問](getting-started/install-self-hosted/faq.md)
* [よくある質問](getting-started/install-self-hosted/faqs.md)
* [Dify Premium](getting-started/dify-premium.md)
* [Dify 教育版](getting-started/dify-for-education.md)
@@ -6,7 +6,7 @@
設定の変更後は、以下のコマンドを実行して、サービスをリスタートさせてください。
```javascript
```bash
docker compose down
docker compose up -d
```
@@ -31,7 +31,7 @@ docker exec -it docker-api-1 flask reset-password
メールアドレスと新しいパスワードを入力するプロンプトが表示されます。例えば:
```
```bash
dify@my-pc:~/hello/dify/docker$ docker compose up -d
[+] Running 9/9
✔ Container docker-web-1 Started 0.1s
@@ -59,10 +59,24 @@ Docker Compose を使用してデプロイする場合、`.env` 設定を変更
Nginx 関連の設定を変更する必要があります:
```
```docker
EXPOSE_NGINX_PORT=80
EXPOSE_NGINX_SSL_PORT=443
```
### 6. docker-api-1 でのデータベース接続エラーの解決方法とは?
他のデプロイに関する質問は[ここに](../../learn-more/faq/install-faq.md)います。
**問題**`http://localhost`アクセス時に`Internal Server Error`が発生し、`docker-api-1`のログに以下エラーが記録される場合:
```bash
FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption
```
**解決策**dbコンテナ内の`/var/lib/postgresql/pgdata/pg_hba.conf`を変更し、エラーメッセージに記載されているネットワークセグメントを認証リストに追加します。例:
```bash
docker exec -it docker-db-1 sh -c "echo 'host all all 172.19.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf"
docker-compose restart
```
他のデプロイに関する質問は[ローカルデプロイに関する](../../learn-more/faq/install-faq.md)をご確認ください。
@@ -88,19 +88,7 @@ docker-web-1 langgenius/dify-web:0.6.13 "/bin/sh ./entrypoin…
docker-worker-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" worker About a minute ago Up About a minute 5001/tcp
```
此时,由于PostgreSQL的安全设置,在docker-api-1的日志中很可能会报出类似以下错误:
```bash
FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption
```
而打开`http://localhost`则提示`Internal Server Error`
你应当修改db容器下的`/var/lib/postgresql/pgdata/pg_hba.conf`,添加对应你报错提示中的网段进入授权名单,例如
```bash
docker exec -it docker-db-1 sh -c "echo 'host all all 172.21.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf"
docker-compose restart
```
通过这些步骤,你应该可以成功在本地安装 Dify。
通过这些步骤,你可以在本地成功安装 Dify。
### 更新 Dify
@@ -31,7 +31,7 @@ docker exec -it docker-api-1 flask reset-password
请按照提示输入邮箱地址和新密码,例如:
```
```bash
dify@my-pc:~/hello/dify/docker$ docker compose up -d
[+] Running 9/9
✔ Container docker-web-1 Started 0.1s
@@ -53,9 +53,9 @@ Password confirm: newpassword4567
Password reset successfully.
```
### 5. 如何修改页面端口
### 5. 如何修改页面端口
如果你使用 Docker Compose 部署,你可以通过修改`.env`配置自定义 Dify 的访问端口。
如果你使用 Docker Compose 部署,你可以通过修改 `.env` 配置自定义 Dify 的访问端口。
你需要修改 Nginx 相关配置:
@@ -64,5 +64,19 @@ EXPOSE_NGINX_PORT=80
EXPOSE_NGINX_SSL_PORT=443
```
其他相关的部署问题请参考[本地部署相关](../../learn-more/faq/install-faq.md)。
其他相关的部署问题请参考[本地部署相关](../../learn-more/faq/install-faq.md)。
### 6. docker-api-1 出现数据库连接报错如何处理?
**问题详情**:访问 `http://localhost` 时提示 `Internal Server Error` 错误;且 `docker-api-1` 的日志中出现了类似错误:
```bash
FATAL: no pg_hba.conf entry for host "172.19.0.7", user "postgres", database "dify", no encryption
```
**解决办法**:修改 db 容器下的 `/var/lib/postgresql/pgdata/pg_hba.conf`,将报错提示中所对应的网段添加至授权名单,例如:
```bash
docker exec -it docker-db-1 sh -c "echo 'host all all 172.19.0.0/16 trust' >> /var/lib/postgresql/data/pgdata/pg_hba.conf"
docker-compose restart
```