To try and ease the rapid deployment of WordPress sites I am thinking of using Docker images for MySQL and WordPress along with a deployment tool to pull customisations from Github.
I’ve got a few Raspberry PIs lying around at home and a wee bit of spare time to investigate this kind of setup.
First off, Find a Linux image to burn to the SD card. The links below include a couple but 1GB isn’t enough space to install additional packages.
Be warned, however, that I’m trying to prepare the SD cards on a Mac and I’m not sure it’s going to be much for resizing the Linux disk partition.
Download the Debian image and burn it to a 16GB SD card,
# sudo -s
# dd if=Downloads/hypriot-rpi-20150301-140537.img of=/dev/disk1 bs=1m
Then we need to expand the root filesystem with – I will complete this a bit later as it can’t be done on a Mac (see resources). This happens automatically when the PI is first booted.
Then boot the PI and I would advise setting a static IP address so that we don’t need the HDMI output and allow remote SSH. Reboot.
Then SSH to the PI from your workstation and grab the dockerfiles for MySQL and WordPress.
# docker run --name WordPress -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.5
The repeat for WordPress,
# docker run --name wordpress --link some-mysql:mysql -p 8080:80 -d wordpress
Okay, so the above commands are exactly correct but you get the gist and this is really a reminder of the links I need to get back to this later on. (Probably should be tracking this via an Asana task).
- http://www.cnx-software.com/2015/03/04/raspbian-image-with-docker-1-5-0-released-for-raspberry-pi-boards/ – Debian image with Docker, but not enough space on root to install MySQL
- http://blog.xebia.com/2014/08/25/docker-on-a-raspberry-pi/ – Good for the above if Arch is your thing
- http://gleenders.blogspot.nl/2014/03/raspberry-pi-resizing-sd-card-root.html – includes instructions for resizing;root partition with 16GB.
- https://www.raspberrypi.org/forums/viewtopic.php?f=5&t=5530 – options for disk resize and writing to SD card; do it on the PI.
- https://github.com/docker-library/docs/tree/master/mysql – docker files for MySQL
- https://github.com/docker-library/docs/tree/master/wordpress – docker file for WordPress