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