Skip to content

Commit 8ae3b3d

Browse files
committed
updated readme, fixed #3
1 parent ef296c9 commit 8ae3b3d

1 file changed

Lines changed: 62 additions & 45 deletions

File tree

README.md

Lines changed: 62 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,34 @@ See `docker-compose.yml` for a usage example.
1212

1313
`attach` or `exec` (etc) into the container and execute `setup`.
1414

15+
docker exec -itu wp CONTAINER bash -l -c 'setup'
16+
1517
This image provides and uses [WP-CLI].
1618

17-
# Configuration
19+
## Download
20+
21+
The version and a locale can be specified with environment variables.
1822

19-
The database configuration can be specified explicitly with:
23+
| Variable | Example | Default
24+
|------------|---------|---------
25+
| WP_VERSION | 4.4.2 | Latest
26+
| WP_LOCALE | en_NZ | en_US
2027

21-
- `WP_DB_HOST`
22-
- `WP_DB_PORT`
23-
- `WP_DB_NAME`
24-
- `WP_DB_USER`
25-
- `WP_DB_PASSWORD`
26-
- `WP_DB_PREFIX`
28+
## Configuration
29+
30+
The database configuration can be specified explicitly with environment variables.
2731

2832
If any are omitted then values are inferred from the linked ```:mysql```
2933
container, otherwise sensible defaults are used.
3034

31-
Variable | Value inferred from | Default
32-
-------------------- | ------------------------------ | ---------
33-
`WP_DB_NAME` | `MYSQL_ENV_MYSQL_DATABASE` | wordpress
34-
`WP_DB_USER` | `MYSQL_ENV_MYSQL_USER` | wordpress
35-
`WP_DB_PASSWORD` | `MYSQL_ENV_MYSQL_PASSWORD` | wordpress
36-
`WP_DB_HOST` | `MYSQL_PORT_3306_TCP_ADDR` | mysql
37-
`WP_DB_PORT` | `MYSQL_PORT_3306_TCP_PORT` | 3306
38-
`WP_DB_PREFIX` | N/A | wp_
35+
| Variable | Value inferred from | Default
36+
|----------------| -------------------------| ---------
37+
| WP_DB_NAME | MYSQL_ENV_MYSQL_DATABASE | wordpress
38+
| WP_DB_USER | MYSQL_ENV_MYSQL_USER | wordpress
39+
| WP_DB_PASSWORD | MYSQL_ENV_MYSQL_PASSWORD | wordpress
40+
| WP_DB_HOST | MYSQL_PORT_3306_TCP_ADDR | mysql
41+
| WP_DB_PORT | MYSQL_PORT_3306_TCP_PORT | 3306
42+
| WP_DB_PREFIX | N/A | wp_
3943

4044
`--extra-php` is supported with the `WP_EXTRA_PHP` environment variable. E.g.
4145

@@ -47,33 +51,32 @@ Variable | Value inferred from | Default
4751
The initial DB is installed, if not already installed in the DB, using the
4852
following variables; the setup script will complain if any are unset.
4953

50-
- `WP_LOCALE` (default `en_NZ`)
51-
- `WP_URL`
52-
- `WP_TITLE`
53-
- `WP_ADMIN_USER`
54-
- `WP_ADMIN_PASSWORD`
55-
- `WP_ADMIN_EMAIL`
54+
| Variable | Example | Default
55+
|-------------------|---------------------|---------
56+
| WP_LOCALE | en_NZ | en_US
57+
| WP_URL | http://example.com |
58+
| WP_TITLE | Example Title |
59+
| WP_ADMIN_EMAIL | admin@example.com |
60+
| WP_ADMIN_USER | admin |
61+
| WP_ADMIN_PASSWORD | |
5662

57-
## Arbitrary WP-CLI Commands
63+
## Multisite
5864

59-
Any arbitrary WP-CLI commands can be executed, actually any commands as the
60-
value is processed by `sh`. Any environment variable prefixed with `WP_COMMANDS`
61-
will be processed.
65+
Multisite is supported, it is enabled when the `WP_SUBDOMAINS` environment
66+
variable is set.
67+
68+
| Variable | Example
69+
|---------------|---------
70+
| WP_SUBDOMAINS | "yes"
6271

63-
WP_COMMANDS_0: |
64-
wp plugin activate --network jetpack
65-
WP_COMMANDS_1: |
66-
wp site create --slug=site1 --title="Site 1"
67-
wp --url=http://site1.example.com rewrite structure /%postname%
68-
wp --url=http://site1.example.com rewrite flush
69-
WP_COMMANDS_2: |
70-
wp site create --slug=site2 --title="Site 2"
71-
wp --url=http://site2.example.com rewrite structure /%postname%
72-
wp --url=http://site2.example.com rewrite flush
73-
WP_COMMANDS_3: |
74-
wp site create --slug=site3 --title="Site 3"
75-
wp --url=http://site3.example.com rewrite structure /%postname%
76-
wp --url=http://site3.example.com rewrite flush
72+
Path-based multisites are not supported.
73+
74+
A domain mapping plugin is not required. Use the convenience function to
75+
register a new site.
76+
77+
WP_COMMANDS: |
78+
new_site sitea sitea.dev http://sitea.dev "Site A"
79+
wp --url=http://sitea.dev theme activate twentyfourteen
7780

7881
## Themes and Plugins
7982

@@ -90,11 +93,11 @@ Themes and plugins can also be installed from [Bitbucket] (OAuth 1.0a supported
9093
for private repositories) and [GitHub] (HTTP Basic Auth using personal access
9194
tokens for private repositories); e.g.:
9295

93-
WP_COMMANDS: |
94-
wp github theme install CherryFramework/CherryFramework v3.1.5
95-
wp github theme install CherryFramework/CherryFramework v3.1.5 --token=XXXXX
96-
wp bitbucket plugin install CherryFramework/cherry-plugin v3.1.5
97-
wp bitbucket plugin install CherryFramework/cherry-plugin v3.1.5 --key=XXXX --secret=XXXXXX
96+
WP_COMMANDS: |
97+
wp github theme install CherryFramework/CherryFramework v3.1.5
98+
wp github theme install CherryFramework/CherryFramework v3.1.5 --token=XXX
99+
wp bitbucket plugin install CherryFramework/cherry-plugin v3.1.5
100+
wp bitbucket plugin install CherryFramework/cherry-plugin v3.1.5 --key=XXX --secret=XXX
98101

99102
For both GitHub and Bitbucket the version/release tag is optional and defaults
100103
to the `latest` release, or if no releases exist, to `master`.
@@ -103,3 +106,17 @@ to the `latest` release, or if no releases exist, to `master`.
103106
[Bitbucket]: https://bitbucket.com
104107
[GitHub]: https://github.com
105108
[WordPress]: https://wordpress.org
109+
110+
## Arbitrary Commands
111+
112+
Any arbitrary commands can be executed, actually any commands as the
113+
value is processed by `sh`. Any environment variable prefixed with `WP_COMMANDS`
114+
will be processed.
115+
116+
WP_COMMANDS_0: | # Install plugins
117+
wp plugin install jetpack --activate
118+
WP_COMMANDS_1: | # Configure themes
119+
wp theme activate twentyfourteen
120+
WP_COMMANDS_2: | # Set some options
121+
wp rewrite structure /%postname%
122+
wp rewrite flush

0 commit comments

Comments
 (0)