This is a template for deploying Wordpress with docker-compose. It is largely based off of xyu/heroku-wp with some extra input from the team at HackingData and HackingUI.
I made this because Virtualbox and Vagrant frustrate me while dockerized things fill me with a deep sense of Zen. Also, my friends at HackingUI wanted a simpler way to develop locally.
- Install docker-compose
- Clone this repository
- run
docker-compose up
Open the docker-compose.yml file It should look like this
web:
image: talolard/easy-wordpress
ports:
- "80:80"
links:
- mysql
- memcache
mysql:
image: orchardup/mysql
ports:
- "3306:3306"
memcache:
image: memcached
environment:
MYSQL_DATABASE: wordpress
In the web section, under the links line add the following
web:
image: talolard/easy-wordpress
ports:
- "80:80"
links:
- mysql
- memcache
volumes:
- /path/to/wp-content/themes:/app/public.built/wp-content/themes
Once you are happy with the changes you made and you want to include the theme in your own docker image do the following
docker build -t tagforyourimage ./
To test it, modify the docker-compose.yml, so that
web:
image: talolard/easy-wordpress
becomes
web:
image: tagforyourimage
This is largely do to xyu/heroku-wp, I just modified the configs a bit so that they would play nicce with docker. The repository is built on top of the following technologies.
- nginx - For serving web content.
- HHVM - A virtual machine designed to serve Hack and PHP.
- MySQL - Provided by the ClearDB add-on.
- Memcached - Provided by the MemCachier add-on.
- Composer - A dependency manager to make installing and managing plugins easier.
In additon repository comes bundled with the following plugins.
- SASL object cache - For running with MemCachier add-on
- Batcache - For full page output caching
- SSL Domain Alias - For sending SSLed traffic to a different domain (needed to send WP admin traffic to Heroku over SSL directly.)
- Authy Two Factor Auth
- Jetpack
- SendGrid
- WP Read-Only
WordPress and most included plugins are installed by Composer on build. To add new plugins or upgrade versions of plugins simply update the composer.json
file and then generate the composer.lock
file with the following command locally:
$ composer update --ignore-platform-reqs
To customize the site simply place files into /public
which upon deploy to Heroku will be copied on top of the standard WordPress install and plugins specified by Composer.
- Add Support for deployment on Heroku and AWS (Beanstalk?)
- Make it easy to change MySQL and MemCache servers
- Test SSl