From 34346ec93f4c01f4522d330875f77ce3da545310 Mon Sep 17 00:00:00 2001
From: Werner Robitza <werner.robitza@gmail.com>
Date: Sun, 7 Apr 2019 12:20:41 +0200
Subject: [PATCH] improve the README

This improves presentation/grammar of the README and adds another sample
command to install WordPress via WP CLI.
---
 README.md | 98 ++++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 64 insertions(+), 34 deletions(-)

diff --git a/README.md b/README.md
index 6cc8c70..e3d4211 100644
--- a/README.md
+++ b/README.md
@@ -1,99 +1,129 @@
-# WPDC - Wordpress Docker Compose
+# WPDC - WordPress Docker Compose
 
-#### Easy Wordpress development with Docker and Docker Compose
+Easy WordPress development with Docker and Docker Compose.
 
-## Starting a new project
+Contents:
+
+- [Requirements](#requirements)
+- [Configuration](#configuration)
+- [Installation](#installation)
+- [Usage](#usage)
+
+## Requirements
 
 Make sure you have the latest versions of **Docker** and **Docker Compose** installed on your machine.
-Copy the files from this repository into a blank folder. In the **docker-compose.yml** file you may change the IP address (in case you run multiple containers) or the database from mysql to mariadb.
 
-Make sure to add your user to the docker group when using linux:
-https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user
+Clone this repository or copy the files from this repository into a new folder. In the **docker-compose.yml** file you may change the IP address (in case you run multiple containers) or the database from MySQL to MariaDB.
+
+Make sure to [add your user to the `docker` group](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) when using Linux.
 
+## Configuration
 
-##### Create containers
+Edit the `.env` file to change the default IP address, MySQL root password and WordPress database name.
+
+## Installation
+
+Open a terminal and `cd` to the folder in which `docker-compose.yml` is saved and run:
 
-Open a terminal and *cd* to the folder you have the docker-compose.yml and run:
 ```
 docker-compose up
 ```
 
-This create 2 new folders beside your docker-compose.yml file.
-* **wp-data** - used to store and restore database dumps
-* **wp-app** - the location of your Wordpress application
+This creates two new folders next to your `docker-compose.yml` file.
+
+* `wp-data` – used to store and restore database dumps
+* `wp-app` – the location of your WordPress application
 
-The containers are now build and running. You should be able to access the Wordpress installation with the configured IP in the browser address. For convenience you may add a new entry into your hosts file.
+The containers are now built and running. You should be able to access the WordPress installation with the configured IP in the browser address. By default it is `http://127.0.0.1`.
 
-##### Starting containers
+For convenience you may add a new entry into your hosts file.
+
+## Usage
+
+### Starting containers
+
+You can start the containers with the `up` command in daemon mode (by adding `-d` as an argument) or by using the `start` command:
 
-You can start the containers with the up command in daemon mode (by adding **-d** as a param) or by using the start command:
 ```
 docker-compose start
 ```
 
-##### Stopping containers
+### Stopping containers
+
 ```
 docker-compose stop
 ```
 
-##### Remove containers
+### Removing containers
+
+To stop and remove all the containers use the`down` command:
 
-To stop and remove all the containers use the **down** command
 ```
 docker-compose down
 ```
-Use **-v** if you need to remove the database volume which is used to persist the database:
+
+Use `-v` if you need to remove the database volume which is used to persist the database:
+
 ```
 docker-compose down -v
 ```
 
-## Project from existing source
+### Project from existing source
+
+Copy the `docker-compose.yml` file into a new directory. In the directory you create two folders:
 
-Copy the docker-compose.yml file into a new directory. In the directory you create two folders:
-* **wp-data** - here you add the database dump
-* **wp-app** - here you copy your existing wordpress code
+* `wp-data` – here you add the database dump
+* `wp-app` – here you copy your existing WordPress code
+
+You can now use the `up` command:
 
-You can now use the **up** command:
 ```
 docker-compose up
 ```
 
-This will create the containers and populate the database with the given dump. You may set your host entry and change it in the database, or you simply overwrite it in the **wp-config.php** by adding
+This will create the containers and populate the database with the given dump. You may set your host entry and change it in the database, or you simply overwrite it in `wp-config.php` by adding:
+
 ```
 define('WP_HOME','http://wp-app.local');
 define('WP_SITEURL','http://wp-app.local');
 ```
 
-## Creating database dumps
+### Creating database dumps
+
 ```
 ./export.sh
 ```
----
 
-## Developing a Theme
+### Developing a Theme
 
-Configure the volume to load the theme in the container in the docker-compose.yml
+Configure the volume to load the theme in the container in the `docker-compose.yml`:
 
 ```
 volumes:
   - ./theme-name/trunk/:/var/www/html/wp-content/themes/theme-name
 ```
 
-## Developing a Plugin
+### Developing a Plugin
 
-Configure the volume to load the plugin in the container in the docker-compose.yml
+Configure the volume to load the plugin in the container in the `docker-compose.yml`:
 
 ```
 volumes:
   - ./plugin-name/trunk/:/var/www/html/wp-content/plugins/plugin-name
 ```
 
+### WP CLI
 
-## WP CLI
+The docker compose configuration also provides a service for using the [WordPress CLI](https://developer.wordpress.org/cli/commands/).
 
-The docker compose configuration also provides a service for using the [Wordpress CLI](https://developer.wordpress.org/cli/commands/).
+Sample command to install WordPress:
+
+```
+docker-compose run --rm wpcli core install --url=http://localhost --title=test --admin_user=admin --admin_email=test@example.com
+```
+
+Or to list installed plugins:
 
-Sample command:
 ```
 docker-compose run --rm wpcli plugin list
 ```
@@ -108,4 +138,4 @@ This way you can use the CLI command above as follows:
 
 ```
 wp plugin list
-```
\ No newline at end of file
+```
-- 
GitLab