mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-11 20:31:18 +00:00
Fix grammar
This commit is contained in:
@@ -23,12 +23,14 @@ wordpress/
|
||||
```yaml
|
||||
services:
|
||||
# 数据库服务
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
container_name: wordpress_db
|
||||
restart: always
|
||||
command:
|
||||
# 使用原生密码认证(旧版 WP 兼容性)
|
||||
|
||||
- --default-authentication-plugin=mysql_native_password
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
@@ -43,6 +45,7 @@ services:
|
||||
- wp_net
|
||||
|
||||
# WordPress 服务
|
||||
|
||||
wordpress:
|
||||
image: wordpress:latest
|
||||
container_name: wordpress_app
|
||||
@@ -57,6 +60,7 @@ services:
|
||||
volumes:
|
||||
- wp_data:/var/www/html
|
||||
# 增加上传文件大小限制
|
||||
|
||||
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
|
||||
depends_on:
|
||||
- db
|
||||
@@ -185,9 +189,7 @@ WordPress 支持 Redis 缓存以提高性能。
|
||||
|
||||
#### Q: 数据库连接错误
|
||||
|
||||
**现象**:访问页面显示 "Error establishing a database connection"。
|
||||
|
||||
**排查**:
|
||||
**现象**:访问页面显示 "Error establishing a database connection"。**排查**:
|
||||
1. 检查 `docker compose logs wordpress`
|
||||
2. 确认 `.env` 中的密码与 YAML 文件引用一致
|
||||
3. 确认 `WORDPRESS_DB_HOST` 也是 `db`(服务名)
|
||||
|
||||
Reference in New Issue
Block a user