mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-26 13:18:34 +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).
|
||||
Reference in New Issue
Block a user