Skip to content

A docker image for WordPress and a docker-compose for fast local and production deployment

Notifications You must be signed in to change notification settings

talolard/wordpress-docker-compose

Repository files navigation

WP docker-compose

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.

QuickStart

 docker-compose up

Adding your own themes

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

This will let you modify locally and see changes live. Building your own container

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

Whats in the box?

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.

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.

Upcoming plans

  • Add Support for deployment on Heroku and AWS (Beanstalk?)
  • Make it easy to change MySQL and MemCache servers
  • Test SSl

About

A docker image for WordPress and a docker-compose for fast local and production deployment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published