Skip to content

Instantly share code, notes, and snippets.

@ukitazume
Last active August 29, 2015 14:24
Show Gist options
  • Save ukitazume/21f82d58654571dd5256 to your computer and use it in GitHub Desktop.
Save ukitazume/21f82d58654571dd5256 to your computer and use it in GitHub Desktop.

WordPress

0. Prepare

  • Dockerhub or Quay.io account
  • Docker runtime at your local machine
  • your Deis

1. Pulling the docker official image of wordpress and run on a local machine

If you are using OSX and boot2docker, run boot2docker

$ boot2docker up
$ $(boot2docker shellinit)

Run wordpress and mysql containter

$ docker run --name wordpress-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql 
$ docker run  --link wordpress-mysql:mysql -p 8080:80 -d wordpress

You can see the site http://${boot2docker ip}:8080

2. Commit and push the container as your image to Dockerhub or Quay.io

$ docker commit #{container id}  #{yourname}/wordpress
$ docker push #{yourname}/wordpress

3. Prepare a MySQL and configure that to deis

You need to prepare MySQL and pass the configuration to the worddpress container via deis config.

$ mkdir wordpress 
$ cd wordpress
$ deis create
$ deis config:set WORDPRESS_DB_HOST=mysqlurl.com:3306
$ deis config:set WORDPRESS_DB_USER=admin
$ deis config:set WORDPRESS_DB_PASSWORD=password

4. Finally deis pull and open the site

$ deis pull #{yourname}/wordpress:latest
$ deis open

Assets management

You need to use S3/Cloudfont plugin of Wordpress for managing assets. https://wordpress.org/plugins/amazon-s3-and-cloudfront/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment