/docker-wordpress

Image for WordPress with some useful tools for development and management

Primary LanguageShell

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.