Project: Wordpress On Dotcloud
Jul 25th, 2011This is a package with the scripts and configuration files needed to deploy Wordpress on Dotcloud.
Copy all the files of this package in the root of your Wordpress directory and push to Dotcloud:
cd wordpress
git clone https://github.com/qpleple/wordpress-on-dotcloud
mv wordpress-on-dotcloud/* .
dotcloud create myblog
dotcloud push myblog
Due to a Dotcloud issue, you may have to push twice the first time:
dotcloud push myblog
. Push local modifications to remote server with:
dotcloud push myblog
Note that remote wp-content/
will not be overwritten. so uploaded
static files will be kept and local plugins and themes will not be
pushed remotely.
Under the hood
The package contains:
-
The
dotcloud.yml
file required to push to Dotcloud declaring 2 services:www: type: php db: type: mysql
-
The
nginx.conf
file telling Nginx to redirect everything to Wordpress front controller as Dotcloud does not support.htaccess
files (included in Wordpress):try_files $uri $uri/ /index.php;
-
The
postinstall
script that is a post-install hook and will be executed by Dotcloud after each push. It executes the scripts in thedotcloud-scripts/
directory. -
The
feed-wp-config.php
script (executed by the post-install hook) that gets the parameters of the just created MySQL Dotcloud service, write them into thewp-config.php
file and create the database if it does not exist. Ifwp-config.php
does not exist, it will create it fromwp-config-sample.php
. -
The
persist-wp-content.sh
script (executed by the post-install hook) that persists thewp-content/
directory containing uploads, installed plugins and themes. It moves the directory from~/code/wp-content
it to~/data/wp-content
and makes a symlink to it, because~/code
will be overwritten at each push.