mirror of https://github.com/docker/docs.git
Merge pull request #359 from londoncalling/compose-wp-sample
finishing touches on Wordpress example in Compose docs per pr#129
This commit is contained in:
commit
962cc88d7f
|
@ -29,35 +29,40 @@ with Docker containers. This quick-start guide demonstrates how to use Compose t
|
||||||
|
|
||||||
$ cd my_wordpress/
|
$ cd my_wordpress/
|
||||||
|
|
||||||
3. Create a `docker-compose.yml` file that will start your `Wordpress` blog and a separate `MySQL` instance with a volume mount for data persistence:
|
3. Create a `docker-compose.yml` file that will start your
|
||||||
|
`Wordpress` blog and a separate `MySQL` instance with a volume
|
||||||
|
mount for data persistence:
|
||||||
|
|
||||||
version: '2'
|
```none
|
||||||
services:
|
version: '2'
|
||||||
db:
|
|
||||||
image: mysql:5.7
|
|
||||||
volumes:
|
|
||||||
- "./.data/db:/var/lib/mysql"
|
|
||||||
restart: always
|
|
||||||
environment:
|
|
||||||
MYSQL_ROOT_PASSWORD: wordpress
|
|
||||||
MYSQL_DATABASE: wordpress
|
|
||||||
MYSQL_USER: wordpress
|
|
||||||
MYSQL_PASSWORD: wordpress
|
|
||||||
|
|
||||||
wordpress:
|
services:
|
||||||
depends_on:
|
db:
|
||||||
- db
|
image: mysql:5.7
|
||||||
image: wordpress:latest
|
volumes:
|
||||||
links:
|
- "./.data/db:/var/lib/mysql"
|
||||||
- db
|
restart: always
|
||||||
ports:
|
environment:
|
||||||
- "8000:80"
|
MYSQL_ROOT_PASSWORD: wordpress
|
||||||
restart: always
|
MYSQL_DATABASE: wordpress
|
||||||
environment:
|
MYSQL_USER: wordpress
|
||||||
WORDPRESS_DB_HOST: db:3306
|
MYSQL_PASSWORD: wordpress
|
||||||
WORDPRESS_DB_PASSWORD: wordpress
|
|
||||||
|
|
||||||
**NOTE**: The folder `./.data/db` will be automatically created in the project directory
|
wordpress:
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
image: wordpress:latest
|
||||||
|
links:
|
||||||
|
- db
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
WORDPRESS_DB_HOST: db:3306
|
||||||
|
WORDPRESS_DB_PASSWORD: wordpress
|
||||||
|
```
|
||||||
|
|
||||||
|
>**NOTE**: The folder `./.data/db` will be automatically created in the project directory
|
||||||
alongside the `docker-compose.yml` which will persist any updates made by wordpress to the
|
alongside the `docker-compose.yml` which will persist any updates made by wordpress to the
|
||||||
database.
|
database.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue