mirror of https://github.com/docker/docs.git
fix: add wordpress volume to docker-compose
This commit is contained in:
parent
54fa0cedea
commit
9fbd215bdf
|
@ -34,8 +34,8 @@ Compose to set up and run WordPress. Before starting, make sure you have
|
|||
```
|
||||
|
||||
3. Create a `docker-compose.yml` file that starts your
|
||||
`WordPress` blog and a separate `MySQL` instance with a volume
|
||||
mount for data persistence:
|
||||
`WordPress` blog and a separate `MySQL` instance with volume
|
||||
mounts for data persistence:
|
||||
|
||||
```yaml
|
||||
version: "{{ site.compose_file_v3 }}"
|
||||
|
@ -56,6 +56,8 @@ Compose to set up and run WordPress. Before starting, make sure you have
|
|||
depends_on:
|
||||
- db
|
||||
image: wordpress:latest
|
||||
volumes:
|
||||
- wordpress_data:/var/www/html
|
||||
ports:
|
||||
- "8000:80"
|
||||
restart: always
|
||||
|
@ -66,12 +68,13 @@ Compose to set up and run WordPress. Before starting, make sure you have
|
|||
WORDPRESS_DB_NAME: wordpress
|
||||
volumes:
|
||||
db_data: {}
|
||||
wordpress_data: {}
|
||||
```
|
||||
|
||||
> **Notes**:
|
||||
>
|
||||
* The docker volume `db_data` persists any updates made by WordPress
|
||||
to the database. [Learn more about docker volumes](../storage/volumes.md)
|
||||
* The docker volumes `db_data` and `wordpress_data` persists updates made by WordPress
|
||||
to the database, as well as the installed themes and plugins. [Learn more about docker volumes](../storage/volumes.md)
|
||||
>
|
||||
* WordPress Multisite works only on ports `80` and `443`.
|
||||
{: .note-vanilla}
|
||||
|
|
Loading…
Reference in New Issue