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
|
3. Create a `docker-compose.yml` file that starts your
|
||||||
`WordPress` blog and a separate `MySQL` instance with a volume
|
`WordPress` blog and a separate `MySQL` instance with volume
|
||||||
mount for data persistence:
|
mounts for data persistence:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "{{ site.compose_file_v3 }}"
|
version: "{{ site.compose_file_v3 }}"
|
||||||
|
@ -56,6 +56,8 @@ Compose to set up and run WordPress. Before starting, make sure you have
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
image: wordpress:latest
|
image: wordpress:latest
|
||||||
|
volumes:
|
||||||
|
- wordpress_data:/var/www/html
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -66,12 +68,13 @@ Compose to set up and run WordPress. Before starting, make sure you have
|
||||||
WORDPRESS_DB_NAME: wordpress
|
WORDPRESS_DB_NAME: wordpress
|
||||||
volumes:
|
volumes:
|
||||||
db_data: {}
|
db_data: {}
|
||||||
|
wordpress_data: {}
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Notes**:
|
> **Notes**:
|
||||||
>
|
>
|
||||||
* The docker volume `db_data` persists any updates made by WordPress
|
* The docker volumes `db_data` and `wordpress_data` persists updates made by WordPress
|
||||||
to the database. [Learn more about docker volumes](../storage/volumes.md)
|
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`.
|
* WordPress Multisite works only on ports `80` and `443`.
|
||||||
{: .note-vanilla}
|
{: .note-vanilla}
|
||||||
|
|
Loading…
Reference in New Issue