README 1.39 KB
Newer Older
Fabio Montefuscolo's avatar
Fabio Montefuscolo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
# WordPress Docker Image

This is an image to help on plugins and themes development, but it
can be used to host a WordPress site as well. There are some tools
and nice librarys included, like *OPCache*, *X-Debug* and *WP-Cli*.


## Development environment (`WP_DEBUG=true`)

There are a WordPress installed at `/var/www/html`. So if you want
to develop a plugin, you can mount your content mapping your plugin
folder in `/var/www/html/wp-content/plugins`.

Let's suppose you want to test your plugin called *Awesome*, your
`docker-compose.yml` should be like this below.

```
web:
  image: montefuscolo/wordpress
  volumes:
   - ./Awesome:/var/www/html/wp-content/plugins/Awesome
  environment:
   - WP_DEBUG=true
  links:
   - db:mysql
  ports:
   - "80:80"

db:
  image: mariadb
  environment:
   - MYSQL_USER=thewpuser
   - MYSQL_PASSWORD=thewppass
   - MYSQL_DATABASE=wordpress
   - MYSQL_ROOT_PASSWORD=thesuperpass
   - TERM=xterm
```


### X-Debug

When you set `WP_DEBUG=true` in container environment, the X-Debug
configuration will be created automatically, and the container will
receive connections from any host. If you want suppress X-Debug,
set an enviroment variable with false value, like `XDEBUG=false`.


## Production Environment

Without `WP_DEBUG`, the container will create automatically the
configuration file to OPCache. You can suppress this behavior by
setting in environment `OPCACHE=false`.