Skip to content

Commit 84bc14c

Browse files
zhanghuidinahRiskey
andauthored
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>
1 parent 4c18b24 commit 84bc14c

4 files changed

Lines changed: 168 additions & 132 deletions

File tree

en/self-host/configuration/environments.mdx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,19 @@ Only effective when starting with docker image or docker-compose.
116116
- GUNICORN_TIMEOUT: Request handling timeout. Default is 200. Recommended value is 360 to support longer SSE (Server-Sent Events) connection times.
117117
- CELERY_WORKER_CLASS: Similar to `SERVER_WORKER_CLASS`. Default is gevent. If using windows, it can be switched to sync or solo.
118118
- CELERY_WORKER_AMOUNT: The number of Celery workers. The default is 1, and can be set as needed.
119+
- 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`.
119120

120121
### Database Configuration
121122

122123
The database uses PostgreSQL. Please use the public schema.
123124

125+
- DB_TYPE: Database type.
126+
127+
Available values include:
128+
129+
- `postgresql`(default)
130+
- `mysql` (MySQL-compatible databases like OceanBase and seekdb can also use this value)
131+
124132
- DB_USERNAME: username
125133
- DB_PASSWORD: password
126134
- DB_HOST: database host
@@ -242,7 +250,7 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
242250

243251
- VECTOR_STORE
244252

245-
**Available enumeration types include:**
253+
Available values include:
246254

247255
- `weaviate`
248256
- `qdrant`
@@ -253,6 +261,7 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
253261
- `analyticdb`
254262
- `couchbase`
255263
- `oceanbase`
264+
- `seekdb` (share the same configuration as `oceanbase`)
256265
- `tablestore`
257266
- `lindorm`
258267
- `tencent`
@@ -412,6 +421,10 @@ Used to store uploaded data set files, team/tenant encryption keys, and other fi
412421

413422
The memory limit of OceanBase vector database, only available for Docker deployment.
414423

424+
- SEEKDB_MEMORY_LIMIT
425+
426+
The memory limit of seekdb, only available for Docker deployment.
427+
415428
- TABLESTORE_ENDPOINT
416429

417430
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
530543
- UPLOAD_FILE_BATCH_LIMIT: The maximum number of files that can be uploaded at a time, default 5.
531544
- ETL_TYPE
532545

533-
**Available enumeration types include:**
546+
Available values include
534547

535548
- dify: Dify's proprietary file extraction scheme
536549
- Unstructured: Unstructured.io file extraction scheme

en/self-host/quick-start/docker-compose.mdx

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ title: Docker Compose
4040
</tbody>
4141
</table>
4242

43-
### Clone Dify
43+
## Clone Dify
4444

4545
Clone the Dify source code to your local machine:
4646

4747
```bash
4848
git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/releases/latest | jq -r .tag_name)" https://github.com/langgenius/dify.git
4949
```
5050

51-
### Starting Dify
51+
## Start Dify
5252

5353
1. Navigate to the Docker directory in the Dify source code
5454

@@ -67,7 +67,7 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
6767
```
6868
4. Start the Docker containers
6969

70-
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:
70+
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:
7171

7272
* If you have Docker Compose V2, use the following command:
7373

@@ -81,47 +81,51 @@ git clone --branch "$(curl -s https://api.github.com/repos/langgenius/dify/relea
8181
docker-compose up -d
8282
```
8383

84-
After executing the command, you should see output similar to the following, showing the status and port mappings of all containers:
84+
After executing the command, you should see output similar to the following, showing the status and start time of all containers:
8585

86-
```bash
87-
[+] Running 11/11
88-
✔ Network docker_ssrf_proxy_network Created 0.1s
89-
✔ Network docker_default Created 0.0s
90-
✔ Container docker-redis-1 Started 2.4s
91-
✔ Container docker-ssrf_proxy-1 Started 2.8s
92-
✔ Container docker-sandbox-1 Started 2.7s
93-
✔ Container docker-web-1 Started 2.7s
94-
✔ Container docker-weaviate-1 Started 2.4s
95-
✔ Container docker-db-1 Started 2.7s
96-
✔ Container docker-api-1 Started 6.5s
97-
✔ Container docker-worker-1 Started 6.4s
98-
✔ Container docker-nginx-1 Started 7.1s
99-
```
86+
```bash
87+
[+] Running 13/13
88+
✔ Network docker_ssrf_proxy_network Created 10.0s
89+
✔ Network docker_default Created 0.1s
90+
✔ Container docker-sandbox-1 Started 0.3s
91+
✔ Container docker-db_postgres-1 Healthy 2.8s
92+
✔ Container docker-web-1 Started 0.3s
93+
✔ Container docker-redis-1 Started 0.3s
94+
✔ Container docker-ssrf_proxy-1 Started 0.4s
95+
✔ Container docker-weaviate-1 Started 0.3s
96+
✔ Container docker-worker_beat-1 Started 3.2s
97+
✔ Container docker-api-1 Started 3.2s
98+
✔ Container docker-worker-1 Started 3.2s
99+
✔ Container docker-plugin_daemon-1 Started 3.2s
100+
✔ Container docker-nginx-1 Started 3.4s
101+
```
100102

101-
Finally, check if all containers are running successfully:
103+
5. Check if all containers are running successfully
102104

103-
```bash
104-
docker compose ps
105-
```
105+
```bash
106+
docker compose ps
107+
```
106108

107-
This includes 3 core services: `api / worker / web`, and 6 dependent components: `weaviate / db / redis / nginx / ssrf_proxy / sandbox` .
109+
This includes 5 core services: `api / worker / worker_beat / web / plugin_daemon`, and 6 dependent components: `weaviate / db_postgres / redis / nginx / ssrf_proxy / sandbox` .
108110

109-
```bash
110-
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
111-
docker-api-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" api About a minute ago Up About a minute 5001/tcp
112-
docker-db-1 postgres:15-alpine "docker-entrypoint.s…" db About a minute ago Up About a minute (healthy) 5432/tcp
113-
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
114-
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis About a minute ago Up About a minute (healthy) 6379/tcp
115-
docker-sandbox-1 langgenius/dify-sandbox:0.2.1 "/main" sandbox About a minute ago Up About a minute
116-
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy About a minute ago Up About a minute 3128/tcp
117-
docker-weaviate-1 semitechnologies/weaviate:1.19.0 "/bin/weaviate --hos…" weaviate About a minute ago Up About a minute
118-
docker-web-1 langgenius/dify-web:0.6.13 "/bin/sh ./entrypoin…" web About a minute ago Up About a minute 3000/tcp
119-
docker-worker-1 langgenius/dify-api:0.6.13 "/bin/bash /entrypoi…" worker About a minute ago Up About a minute 5001/tcp
120-
```
111+
```bash
112+
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
113+
docker-api-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" api 26 seconds ago Up 22 seconds 5001/tcp
114+
docker-db_postgres-1 postgres:15-alpine "docker-entrypoint.s…" db_postgres 26 seconds ago Up 25 seconds (healthy) 5432/tcp
115+
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
116+
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
117+
docker-redis-1 redis:6-alpine "docker-entrypoint.s…" redis 26 seconds ago Up 25 seconds (health: starting) 6379/tcp
118+
docker-sandbox-1 langgenius/dify-sandbox:0.2.12 "/main" sandbox 26 seconds ago Up 25 seconds (health: starting)
119+
docker-ssrf_proxy-1 ubuntu/squid:latest "sh -c 'cp /docker-e…" ssrf_proxy 26 seconds ago Up 25 seconds 3128/tcp
120+
docker-weaviate-1 semitechnologies/weaviate:1.27.0 "/bin/weaviate --hos…" weaviate 26 seconds ago Up 25 seconds
121+
docker-web-1 langgenius/dify-web:1.10.1 "/bin/sh ./entrypoin…" web 26 seconds ago Up 25 seconds 3000/tcp
122+
docker-worker-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker 26 seconds ago Up 22 seconds 5001/tcp
123+
docker-worker_beat-1 langgenius/dify-api:1.10.1 "/bin/bash /entrypoi…" worker_beat 26 seconds ago Up 22 seconds 5001/tcp
124+
```
121125

122126
With these steps, you should be able to install Dify successfully.
123127

124-
### Upgrade Dify
128+
## Upgrade Dify
125129

126130
Enter the docker directory of the dify source code and execute the following commands:
127131

@@ -133,12 +137,13 @@ docker compose pull
133137
docker compose up -d
134138
```
135139

136-
#### Sync Environment Variable Configuration (Important)
140+
<Note>
141+
* If the `.env.example` file has been updated, be sure to modify your local `.env` file accordingly.
137142

138-
* If the `.env.example` file has been updated, be sure to modify your local `.env` file accordingly.
139-
* 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.
143+
* 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.
144+
</Note>
140145

141-
### Access Dify
146+
## Access Dify
142147

143148
Access administrator initialization page to set up the admin account:
144149

@@ -160,7 +165,7 @@ http://localhost
160165
http://your_server_ip
161166
```
162167

163-
### Customize Dify
168+
## Customize Dify
164169

165170
Edit the environment variable values in your `.env` file directly. Then, restart Dify with:
166171

@@ -169,8 +174,10 @@ docker compose down
169174
docker compose up -d
170175
```
171176

172-
The full set of annotated environment variables along can be found under docker/.env.example.
177+
<Tip>
178+
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).
179+
</Tip>
173180

174-
### Read More
181+
## Read More
175182

176-
If you have any questions, please refer to [FAQs](/en/self-host/quick-start/faqs).
183+
If you have any questions, see [FAQs](/en/self-host/quick-start/faqs).

0 commit comments

Comments
 (0)