mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-27 13:28:32 +07:00
feat(docs):add docs for mysql adaptation (#577)
* feat(docs):add docs for mysql adaptation * changes after review --------- Co-authored-by: Riskey <riskey47@dify.ai>
This commit is contained in:
@@ -116,11 +116,19 @@ Only effective when starting with docker image or docker-compose.
|
||||
- GUNICORN_TIMEOUT: Request handling timeout. Default is 200. Recommended value is 360 to support longer SSE (Server-Sent Events) connection times.
|
||||
- CELERY_WORKER_CLASS: Similar to `SERVER_WORKER_CLASS`. Default is gevent. If using windows, it can be switched to sync or solo.
|
||||
- CELERY_WORKER_AMOUNT: The number of Celery workers. The default is 1, and can be set as needed.
|
||||
- COMPOSE_PROFILES: Selectively start service groups. The default value is `${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql}`, which is automatically derived from `VECTOR_STORE` and `DB_TYPE`.
|
||||
|
||||
### Database Configuration
|
||||
|
||||
The database uses PostgreSQL. Please use the public schema.
|
||||
|
||||
- DB_TYPE: Database type.
|
||||
|
||||
Available values include:
|
||||
|
||||
- `postgresql`(default)
|
||||
- `mysql` (MySQL-compatible databases like OceanBase and seekdb can also use this value)
|
||||
|
||||
- DB_USERNAME: username
|
||||
- DB_PASSWORD: password
|
||||
- DB_HOST: database host
|
||||
@@ -242,7 +250,7 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
|
||||
|
||||
- VECTOR_STORE
|
||||
|
||||
**Available enumeration types include:**
|
||||
Available values include:
|
||||
|
||||
- `weaviate`
|
||||
- `qdrant`
|
||||
@@ -253,6 +261,7 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
|
||||
- `analyticdb`
|
||||
- `couchbase`
|
||||
- `oceanbase`
|
||||
- `seekdb` (share the same configuration as `oceanbase`)
|
||||
- `tablestore`
|
||||
- `lindorm`
|
||||
- `tencent`
|
||||
@@ -412,6 +421,10 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
|
||||
|
||||
The memory limit of OceanBase vector database, only available for Docker deployment.
|
||||
|
||||
- SEEKDB_MEMORY_LIMIT
|
||||
|
||||
The memory limit of seekdb, only available for Docker deployment.
|
||||
|
||||
- TABLESTORE_ENDPOINT
|
||||
|
||||
The endpoint address of the TableStore server (e.g. 'https://instance-name.cn-hangzhou.ots.aliyuncs.com')
|
||||
@@ -530,7 +543,7 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
|
||||
- UPLOAD_FILE_BATCH_LIMIT: The maximum number of files that can be uploaded at a time, default 5.
|
||||
- ETL_TYPE
|
||||
|
||||
**Available enumeration types include:**
|
||||
Available values include:
|
||||
|
||||
- dify: Dify's proprietary file extraction scheme
|
||||
- Unstructured: Unstructured.io file extraction scheme
|
||||
|
||||
@@ -40,7 +40,7 @@ title: Docker Compose
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### Clone Dify
|
||||
## Clone Dify
|
||||
|
||||
Clone the Dify source code to your local machine:
|
||||
|
||||
@@ -48,7 +48,7 @@ Clone the Dify source code to your local machine:
|
||||
git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
|
||||
```
|
||||
|
||||
### Starting Dify
|
||||
## Start Dify
|
||||
|
||||
1. Navigate to the Docker directory in the Dify source code
|
||||
|
||||
@@ -67,7 +67,7 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
|
||||
```
|
||||
4. Start the Docker containers
|
||||
|
||||
Choose the appropriate command to start the containers based on the Docker Compose version on your system. You can use the `$ docker compose version` command to check the version, and refer to the [Docker documentation](https://docs.docker.com/compose/install/) for more information:
|
||||
Choose the appropriate command to start the containers based on the Docker Compose version on your system. You can use the `docker compose version` command to check the version, and refer to the [Docker documentation](https://docs.docker.com/compose/install/) for more information:
|
||||
|
||||
* If you have Docker Compose V2, use the following command:
|
||||
|
||||
@@ -81,47 +81,51 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
After executing the command, you should see output similar to the following, showing the status and port mappings of all containers:
|
||||
After executing the command, you should see output similar to the following, showing the status and start time of all containers:
|
||||
|
||||
```bash
|
||||
[+] Running 11/11
|
||||
✔ Network docker_ssrf_proxy_network Created 0.1s
|
||||
✔ Network docker_default Created 0.0s
|
||||
✔ Container docker-redis-1 Started 2.4s
|
||||
✔ Container docker-ssrf_proxy-1 Started 2.8s
|
||||
✔ Container docker-sandbox-1 Started 2.7s
|
||||
✔ Container docker-web-1 Started 2.7s
|
||||
✔ Container docker-weaviate-1 Started 2.4s
|
||||
✔ Container docker-db-1 Started 2.7s
|
||||
✔ Container docker-api-1 Started 6.5s
|
||||
✔ Container docker-worker-1 Started 6.4s
|
||||
✔ Container docker-nginx-1 Started 7.1s
|
||||
```
|
||||
```bash
|
||||
[+] Running 13/13
|
||||
✔ Network docker_ssrf_proxy_network Created 10.0s
|
||||
✔ Network docker_default Created 0.1s
|
||||
✔ Container docker-sandbox-1 Started 0.3s
|
||||
✔ Container docker-db_postgres-1 Healthy 2.8s
|
||||
✔ Container docker-web-1 Started 0.3s
|
||||
✔ Container docker-redis-1 Started 0.3s
|
||||
✔ Container docker-ssrf_proxy-1 Started 0.4s
|
||||
✔ Container docker-weaviate-1 Started 0.3s
|
||||
✔ Container docker-worker_beat-1 Started 3.2s
|
||||
✔ Container docker-api-1 Started 3.2s
|
||||
✔ Container docker-worker-1 Started 3.2s
|
||||
✔ Container docker-plugin_daemon-1 Started 3.2s
|
||||
✔ Container docker-nginx-1 Started 3.4s
|
||||
```
|
||||
|
||||
Finally, check if all containers are running successfully:
|
||||
5. Check if all containers are running successfully
|
||||
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
This includes 3 core services: `api / worker / web`, and 6 dependent components: `weaviate / db / redis / nginx / ssrf_proxy / sandbox` .
|
||||
This includes 5 core services: `api / worker / worker_beat / web / plugin_daemon`, and 6 dependent components: `weaviate / db_postgres / redis / nginx / ssrf_proxy / sandbox` .
|
||||
|
||||
```bash
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
docker-api-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" api About a minute ago Up About a minute 5001/tcp
|
||||
docker-db-1 postgres:15-alpine "docker-entrypoint.s…" db About a minute ago Up About a minute (healthy) 5432/tcp
|
||||
docker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx About a minute ago Up About a minute 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
|
||||
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis About a minute ago Up About a minute (healthy) 6379/tcp
|
||||
docker-sandbox-1 langgenius/dify-sandbox:0.2.1 "/main" sandbox About a minute ago Up About a minute
|
||||
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy About a minute ago Up About a minute 3128/tcp
|
||||
docker-weaviate-1 semitechnologies/weaviate:1.19.0 "/bin/weaviate --hos…" weaviate About a minute ago Up About a minute
|
||||
docker-web-1 langgenius/dify-web:0.6.13 "/bin/sh ./entrypoin…" web About a minute ago Up About a minute 3000/tcp
|
||||
docker-worker-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" worker About a minute ago Up About a minute 5001/tcp
|
||||
```
|
||||
```bash
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
docker-api-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" api 26 seconds ago Up 22 seconds 5001/tcp
|
||||
docker-db_postgres-1 postgres:15-alpine "docker-entrypoint.s…" db_postgres 26 seconds ago Up 25 seconds (healthy) 5432/tcp
|
||||
docker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx 26 seconds ago Up 22 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
|
||||
docker-plugin_daemon-1 langgenius/dify-plugin-daemon:0.4.1-local "/bin/bash -c /app/e…" plugin_daemon 26 seconds ago Up 22 seconds 0.0.0.0:5003->5003/tcp, :::5003->5003/tcp
|
||||
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis 26 seconds ago Up 25 seconds (health: starting) 6379/tcp
|
||||
docker-sandbox-1 langgenius/dify-sandbox:0.2.12 "/main" sandbox 26 seconds ago Up 25 seconds (health: starting)
|
||||
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy 26 seconds ago Up 25 seconds 3128/tcp
|
||||
docker-weaviate-1 semitechnologies/weaviate:1.27.0 "/bin/weaviate --hos…" weaviate 26 seconds ago Up 25 seconds
|
||||
docker-web-1 langgenius/dify-web:1.10.1 "/bin/sh ./entrypoin…" web 26 seconds ago Up 25 seconds 3000/tcp
|
||||
docker-worker-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker 26 seconds ago Up 22 seconds 5001/tcp
|
||||
docker-worker_beat-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker_beat 26 seconds ago Up 22 seconds 5001/tcp
|
||||
```
|
||||
|
||||
With these steps, you should be able to install Dify successfully.
|
||||
|
||||
### Upgrade Dify
|
||||
## Upgrade Dify
|
||||
|
||||
Enter the docker directory of the dify source code and execute the following commands:
|
||||
|
||||
@@ -133,12 +137,13 @@ docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
#### Sync Environment Variable Configuration (Important)
|
||||
<Note>
|
||||
* If the `.env.example` file has been updated, be sure to modify your local `.env` file accordingly.
|
||||
|
||||
* If the `.env.example` file has been updated, be sure to modify your local `.env` file accordingly.
|
||||
* Check and modify the configuration items in the `.env` file as needed to ensure they match your actual environment. You may need to add any new variables from `.env.example` to your `.env` file, and update any values that have changed.
|
||||
* Check and modify the configuration items in the `.env` file as needed to ensure they match your actual environment. You may need to add any new variables from `.env.example` to your `.env` file, and update any values that have changed.
|
||||
</Note>
|
||||
|
||||
### Access Dify
|
||||
## Access Dify
|
||||
|
||||
Access administrator initialization page to set up the admin account:
|
||||
|
||||
@@ -160,7 +165,7 @@ http://localhost
|
||||
http://your_server_ip
|
||||
```
|
||||
|
||||
### Customize Dify
|
||||
## Customize Dify
|
||||
|
||||
Edit the environment variable values in your `.env` file directly. Then, restart Dify with:
|
||||
|
||||
@@ -169,8 +174,10 @@ docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
The full set of annotated environment variables along can be found under docker/.env.example.
|
||||
<Tip>
|
||||
The full set of annotated environment variables along can be found under `docker/.env.example`. For more information, see [environment variables](/en/self-host/configuration/environments).
|
||||
</Tip>
|
||||
|
||||
### Read More
|
||||
## Read More
|
||||
|
||||
If you have any questions, please refer to [FAQs](/en/self-host/quick-start/faqs).
|
||||
If you have any questions, see [FAQs](/en/self-host/quick-start/faqs).
|
||||
@@ -42,7 +42,7 @@ title: Docker Compose
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### Difyのクローン
|
||||
## Difyのクローン
|
||||
|
||||
Difyのソースコードをローカルマシンにクローンします:
|
||||
|
||||
@@ -50,7 +50,7 @@ Difyのソースコードをローカルマシンにクローンします:
|
||||
git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
|
||||
```
|
||||
|
||||
### Difyの起動
|
||||
## Difyの起動
|
||||
|
||||
1. Difyソースコード内のDockerディレクトリに移動します
|
||||
|
||||
@@ -69,7 +69,7 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
|
||||
```
|
||||
4. Dockerコンテナを起動します
|
||||
|
||||
システムのDocker Composeバージョンに基づいて、適切なコマンドを選択してコンテナを起動してください。バージョンを確認するには`$ docker compose version`コマンドを使用し、詳細については[Dockerドキュメント](https://docs.docker.com/compose/install/)を参照してください:
|
||||
システムのDocker Composeバージョンに基づいて、適切なコマンドを選択してコンテナを起動してください。バージョンを確認するには`docker compose version`コマンドを使用し、詳細については[Dockerドキュメント](https://docs.docker.com/compose/install/)を参照してください:
|
||||
|
||||
* Docker Compose V2を使用している場合は、以下のコマンドを使用します:
|
||||
|
||||
@@ -83,47 +83,51 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
コマンドを実行すると、すべてのコンテナのステータスとポートマッピングを示す以下のような出力が表示されるはずです:
|
||||
コマンドを実行すると、すべてのコンテナのステータスと起動時間を示す以下のような出力が表示されるはずです:
|
||||
|
||||
```bash
|
||||
[+] Running 11/11
|
||||
✔ Network docker_ssrf_proxy_network Created 0.1s
|
||||
✔ Network docker_default Created 0.0s
|
||||
✔ Container docker-redis-1 Started 2.4s
|
||||
✔ Container docker-ssrf_proxy-1 Started 2.8s
|
||||
✔ Container docker-sandbox-1 Started 2.7s
|
||||
✔ Container docker-web-1 Started 2.7s
|
||||
✔ Container docker-weaviate-1 Started 2.4s
|
||||
✔ Container docker-db-1 Started 2.7s
|
||||
✔ Container docker-api-1 Started 6.5s
|
||||
✔ Container docker-worker-1 Started 6.4s
|
||||
✔ Container docker-nginx-1 Started 7.1s
|
||||
```
|
||||
```bash
|
||||
[+] Running 13/13
|
||||
✔ Network docker_ssrf_proxy_network Created 10.0s
|
||||
✔ Network docker_default Created 0.1s
|
||||
✔ Container docker-sandbox-1 Started 0.3s
|
||||
✔ Container docker-db_postgres-1 Healthy 2.8s
|
||||
✔ Container docker-web-1 Started 0.3s
|
||||
✔ Container docker-redis-1 Started 0.3s
|
||||
✔ Container docker-ssrf_proxy-1 Started 0.4s
|
||||
✔ Container docker-weaviate-1 Started 0.3s
|
||||
✔ Container docker-worker_beat-1 Started 3.2s
|
||||
✔ Container docker-api-1 Started 3.2s
|
||||
✔ Container docker-worker-1 Started 3.2s
|
||||
✔ Container docker-plugin_daemon-1 Started 3.2s
|
||||
✔ Container docker-nginx-1 Started 7.1s
|
||||
```
|
||||
|
||||
最後に、すべてのコンテナが正常に動作しているかを確認します:
|
||||
5. すべてのコンテナが正常に動作しているかを確認します
|
||||
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
これには3つのコアサービス:`api / worker / web`と、6つの依存コンポーネント:`weaviate / db / redis / nginx / ssrf_proxy / sandbox`が含まれます。
|
||||
これは5つのビジネスサービス `api / worker / worker_beat / web / plugin_daemon` と6つの基礎コンポーネント `weaviate / db_postgres / redis / nginx / ssrf_proxy / sandbox` を含まれます。
|
||||
|
||||
```bash
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
docker-api-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" api About a minute ago Up About a minute 5001/tcp
|
||||
docker-db-1 postgres:15-alpine "docker-entrypoint.s…" db About a minute ago Up About a minute (healthy) 5432/tcp
|
||||
docker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx About a minute ago Up About a minute 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
|
||||
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis About a minute ago Up About a minute (healthy) 6379/tcp
|
||||
docker-sandbox-1 langgenius/dify-sandbox:0.2.1 "/main" sandbox About a minute ago Up About a minute
|
||||
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy About a minute ago Up About a minute 3128/tcp
|
||||
docker-weaviate-1 semitechnologies/weaviate:1.19.0 "/bin/weaviate --hos…" weaviate About a minute ago Up About a minute
|
||||
docker-web-1 langgenius/dify-web:0.6.13 "/bin/sh ./entrypoin…" web About a minute ago Up About a minute 3000/tcp
|
||||
docker-worker-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" worker About a minute ago Up About a minute 5001/tcp
|
||||
```
|
||||
```bash
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
docker-api-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" api 26 seconds ago Up 22 seconds 5001/tcp
|
||||
docker-db_postgres-1 postgres:15-alpine "docker-entrypoint.s…" db_postgres 26 seconds ago Up 25 seconds (healthy) 5432/tcp
|
||||
docker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx 26 seconds ago Up 22 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
|
||||
docker-plugin_daemon-1 langgenius/dify-plugin-daemon:0.4.1-local "/bin/bash -c /app/e…" plugin_daemon 26 seconds ago Up 22 seconds 0.0.0.0:5003->5003/tcp, :::5003->5003/tcp
|
||||
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis 26 seconds ago Up 25 seconds (health: starting) 6379/tcp
|
||||
docker-sandbox-1 langgenius/dify-sandbox:0.2.12 "/main" sandbox 26 seconds ago Up 25 seconds (health: starting)
|
||||
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy 26 seconds ago Up 25 seconds 3128/tcp
|
||||
docker-weaviate-1 semitechnologies/weaviate:1.27.0 "/bin/weaviate --hos…" weaviate 26 seconds ago Up 25 seconds
|
||||
docker-web-1 langgenius/dify-web:1.10.1 "/bin/sh ./entrypoin…" web 26 seconds ago Up 25 seconds 3000/tcp
|
||||
docker-worker-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker 26 seconds ago Up 22 seconds 5001/tcp
|
||||
docker-worker_beat-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker_beat 26 seconds ago Up 22 seconds
|
||||
```
|
||||
|
||||
これらの手順により、Difyを正常にインストールできるはずです。
|
||||
|
||||
### Difyのアップグレード
|
||||
## Difyのアップグレード
|
||||
|
||||
difyソースコードのdockerディレクトリに移動し、以下のコマンドを実行します:
|
||||
|
||||
@@ -135,12 +139,13 @@ docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
#### 環境変数設定の同期(重要)
|
||||
<Note>
|
||||
* `.env.example`ファイルが更新されている場合は、必ずローカルの`.env`ファイルをそれに応じて変更してください。
|
||||
|
||||
* `.env.example`ファイルが更新されている場合は、必ずローカルの`.env`ファイルをそれに応じて変更してください。
|
||||
* 実際の環境に合わせて`.env`ファイルの設定項目を確認・変更してください。`.env.example`から新しい変数を`.env`ファイルに追加し、変更された値を更新する必要がある場合があります。
|
||||
* 実際の環境に合わせて`.env`ファイルの設定項目を確認・変更してください。`.env.example`から新しい変数を`.env`ファイルに追加し、変更された値を更新する必要がある場合があります。
|
||||
</Note>
|
||||
|
||||
### Difyへのアクセス
|
||||
## Difyへのアクセス
|
||||
|
||||
管理者初期化ページにアクセスして、管理者アカウントを設定します:
|
||||
|
||||
@@ -162,7 +167,7 @@ http://localhost
|
||||
http://your_server_ip
|
||||
```
|
||||
|
||||
### Difyのカスタマイズ
|
||||
## Difyのカスタマイズ
|
||||
|
||||
`.env`ファイルの環境変数値を直接編集します。その後、以下のコマンドでDifyを再起動します:
|
||||
|
||||
@@ -171,8 +176,10 @@ docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
完全な注釈付き環境変数セットは docker/.env.example で見つけることができます。
|
||||
<Tip>
|
||||
完全な注釈付き環境変数セットは docker/.env.example で見つけることができます。詳細については、[環境変数](/ja/self-host/configuration/environments)を参照してください。
|
||||
</Tip>
|
||||
|
||||
### 詳細情報
|
||||
## 詳細情報
|
||||
|
||||
ご質問がある場合は、[FAQ](/ja/self-host/quick-start/faqs)を参照してください。
|
||||
@@ -42,7 +42,7 @@ title: Docker Compose
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
### 克隆 Dify
|
||||
## 克隆 Dify
|
||||
|
||||
将 Dify 源代码克隆到本地机器:
|
||||
|
||||
@@ -50,7 +50,7 @@ title: Docker Compose
|
||||
git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
|
||||
```
|
||||
|
||||
### 启动 Dify
|
||||
## 启动 Dify
|
||||
|
||||
1. 导航到 Dify 源代码中的 Docker 目录
|
||||
|
||||
@@ -69,7 +69,7 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
|
||||
```
|
||||
4. 启动 Docker 容器
|
||||
|
||||
根据你系统上的 Docker Compose 版本选择适当的命令来启动容器。你可以使用 `$ docker compose version` 命令检查版本,并参考 [Docker 文档](https://docs.docker.com/compose/install/) 获取更多信息:
|
||||
根据你系统上的 Docker Compose 版本选择适当的命令来启动容器。你可以使用 `$ docker compose version` 命令检查版本,并参考 [Docker 文档](https://docs.docker.com/compose/install/) 获取更多信息。
|
||||
|
||||
* 如果你使用 Docker Compose V2,使用以下命令:
|
||||
|
||||
@@ -83,47 +83,51 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
执行命令后,你应该看到类似以下的输出,显示所有容器的状态和端口映射:
|
||||
执行命令后,你应该看到类似以下的输出,显示所有容器的状态和启动时间:
|
||||
|
||||
```bash
|
||||
[+] Running 11/11
|
||||
✔ Network docker_ssrf_proxy_network Created 0.1s
|
||||
✔ Network docker_default Created 0.0s
|
||||
✔ Container docker-redis-1 Started 2.4s
|
||||
✔ Container docker-ssrf_proxy-1 Started 2.8s
|
||||
✔ Container docker-sandbox-1 Started 2.7s
|
||||
✔ Container docker-web-1 Started 2.7s
|
||||
✔ Container docker-weaviate-1 Started 2.4s
|
||||
✔ Container docker-db-1 Started 2.7s
|
||||
✔ Container docker-api-1 Started 6.5s
|
||||
✔ Container docker-worker-1 Started 6.4s
|
||||
✔ Container docker-nginx-1 Started 7.1s
|
||||
```
|
||||
```bash
|
||||
[+] Running 13/13
|
||||
✔ Network docker_ssrf_proxy_network Created 10.0s
|
||||
✔ Network docker_default Created 0.1s
|
||||
✔ Container docker-sandbox-1 Started 0.3s
|
||||
✔ Container docker-db_postgres-1 Healthy 2.8s
|
||||
✔ Container docker-web-1 Started 0.3s
|
||||
✔ Container docker-redis-1 Started 0.3s
|
||||
✔ Container docker-ssrf_proxy-1 Started 0.4s
|
||||
✔ Container docker-weaviate-1 Started 0.3s
|
||||
✔ Container docker-worker_beat-1 Started 3.2s
|
||||
✔ Container docker-api-1 Started 3.2s
|
||||
✔ Container docker-worker-1 Started 3.2s
|
||||
✔ Container docker-plugin_daemon-1 Started 3.2s
|
||||
✔ Container docker-nginx-1 Started 3.4s
|
||||
```
|
||||
|
||||
最后,检查所有容器是否成功运行:
|
||||
5. 检查所有容器是否成功运行
|
||||
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
```bash
|
||||
docker compose ps
|
||||
```
|
||||
|
||||
这包括 3 个核心服务:`api / worker / web`,以及 6 个依赖组件:`weaviate / db / redis / nginx / ssrf_proxy / sandbox`。
|
||||
在这个输出中,你应该可以看到包括 5 个业务服务 `api / worker / worker_beat / web / plugin_daemon`,以及 6 个基础组件 `weaviate / db_postgres / redis / nginx / ssrf_proxy / sandbox` 。
|
||||
|
||||
```bash
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
docker-api-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" api About a minute ago Up About a minute 5001/tcp
|
||||
docker-db-1 postgres:15-alpine "docker-entrypoint.s…" db About a minute ago Up About a minute (healthy) 5432/tcp
|
||||
docker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx About a minute ago Up About a minute 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
|
||||
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis About a minute ago Up About a minute (healthy) 6379/tcp
|
||||
docker-sandbox-1 langgenius/dify-sandbox:0.2.1 "/main" sandbox About a minute ago Up About a minute
|
||||
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy About a minute ago Up About a minute 3128/tcp
|
||||
docker-weaviate-1 semitechnologies/weaviate:1.19.0 "/bin/weaviate --hos…" weaviate About a minute ago Up About a minute
|
||||
docker-web-1 langgenius/dify-web:0.6.13 "/bin/sh ./entrypoin…" web About a minute ago Up About a minute 3000/tcp
|
||||
docker-worker-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" worker About a minute ago Up About a minute 5001/tcp
|
||||
```
|
||||
```bash
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
docker-api-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" api 26 seconds ago Up 22 seconds 5001/tcp
|
||||
docker-db_postgres-1 postgres:15-alpine "docker-entrypoint.s…" db_postgres 26 seconds ago Up 25 seconds (healthy) 5432/tcp
|
||||
docker-nginx-1 nginx:latest "sh -c 'cp /docker-e…" nginx 26 seconds ago Up 22 seconds 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp
|
||||
docker-plugin_daemon-1 langgenius/dify-plugin-daemon:0.4.1-local "/bin/bash -c /app/e…" plugin_daemon 26 seconds ago Up 22 seconds 0.0.0.0:5003->5003/tcp, :::5003->5003/tcp
|
||||
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis 26 seconds ago Up 25 seconds (health: starting) 6379/tcp
|
||||
docker-sandbox-1 langgenius/dify-sandbox:0.2.12 "/main" sandbox 26 seconds ago Up 25 seconds (health: starting)
|
||||
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy 26 seconds ago Up 25 seconds 3128/tcp
|
||||
docker-weaviate-1 semitechnologies/weaviate:1.27.0 "/bin/weaviate --hos…" weaviate 26 seconds ago Up 25 seconds
|
||||
docker-web-1 langgenius/dify-web:1.10.1 "/bin/sh ./entrypoin…" web 26 seconds ago Up 25 seconds 3000/tcp
|
||||
docker-worker-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker 26 seconds ago Up 22 seconds 5001/tcp
|
||||
docker-worker_beat-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker_beat 26 seconds ago Up 22 seconds 5001/tcp
|
||||
```
|
||||
|
||||
通过这些步骤,你应该能够成功安装 Dify。
|
||||
|
||||
### 升级 Dify
|
||||
## 升级 Dify
|
||||
|
||||
进入 Dify 源代码的 docker 目录并执行以下命令:
|
||||
|
||||
@@ -135,12 +139,13 @@ docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
#### 同步环境变量配置(重要)
|
||||
<Note>
|
||||
* 如果 `.env.example` 文件已更新,请确保相应地修改你的本地 `.env` 文件。
|
||||
|
||||
* 如果 `.env.example` 文件已更新,请确保相应地修改你的本地 `.env` 文件。
|
||||
* 根据需要检查和修改 `.env` 文件中的配置项,确保它们与你的实际环境匹配。你可能需要将 `.env.example` 中的任何新变量添加到你的 `.env` 文件中,并更新任何已更改的值。
|
||||
* 根据需要检查和修改 `.env` 文件中的配置项,确保它们与你的实际环境匹配。你可能需要将 `.env.example` 中的任何新变量添加到你的 `.env` 文件中,并更新任何已更改的值。
|
||||
</Note>
|
||||
|
||||
### 访问 Dify
|
||||
## 访问 Dify
|
||||
|
||||
访问管理员初始化页面以设置管理员账户:
|
||||
|
||||
@@ -162,17 +167,21 @@ http://localhost
|
||||
http://your_server_ip
|
||||
```
|
||||
|
||||
### 自定义 Dify
|
||||
## 自定义 Dify
|
||||
|
||||
直接编辑你的 `.env` 文件中的环境变量值。然后,使用以下命令重启 Dify:
|
||||
|
||||
|
||||
```
|
||||
docker compose down
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
完整的带注释环境变量集合可在 docker/.env.example 下找到。
|
||||
<Tip>
|
||||
完整的带注释环境变量集合可在 `docker/.env.example` 中找到。详细说明请参考 [环境变量](/zh/self-host/configuration/environments)。
|
||||
</Tip>
|
||||
|
||||
### 了解更多
|
||||
|
||||
## 了解更多
|
||||
|
||||
如果你有任何问题,请参阅 [常见问题解答](/zh/self-host/quick-start/faqs)。
|
||||
|
||||
Reference in New Issue
Block a user