fix: add wordpress volume to docker-compose

This commit is contained in:
Seth Falco 2021-06-06 01:20:46 +02:00 committed by GitHub
parent 54fa0cedea
commit 9fbd215bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -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}