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.ymlfile required to push to Dotcloud declaring 2 services:www: type: php db: type: mysql - 
    
The
nginx.conffile telling Nginx to redirect everything to Wordpress front controller as Dotcloud does not support.htaccessfiles (included in Wordpress):try_files $uri $uri/ /index.php; - 
    
The
postinstallscript 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.phpscript (executed by the post-install hook) that gets the parameters of the just created MySQL Dotcloud service, write them into thewp-config.phpfile and create the database if it does not exist. Ifwp-config.phpdoes not exist, it will create it fromwp-config-sample.php. - 
    
The
persist-wp-content.shscript (executed by the post-install hook) that persists thewp-content/directory containing uploads, installed plugins and themes. It moves the directory from~/code/wp-contentit to~/data/wp-contentand makes a symlink to it, because~/codewill be overwritten at each push.