HyperScale WordPress in AWS With Docker
@ngineered
@ngineered
HyperScale WordPress in AWS
Deployment + Architecture
Best practices in AWS:
Infrastructure
Deployment
Plugins and PaaS
How to integrate WordPress with AWS:
What We Will Cover
@ngineered
Why Use Docker?
Very lightweight compared to traditional VM’s
Docker allows you to package the same configuration in:
When you need to repeatedly ship and deploy to lots of systems its reliable, as it allows you to group:
You know it’s going to run when it comes to going live!
@ngineered
Docker on AWS
Parts Relevant to WordPress
@ngineered
Docker on AWS
@ngineered
The Container
https://registry.hub.docker.com/u/richarvey/nginx-php-fpm/
What’s included in the container:
+
+
@ngineered
Version Control
https://registry.hub.docker.com/u/richarvey/nginx-php-fpm/
The Container can pull code from git.
This allows you to ‘easily’ work on multiple features and/or fixes at the same time and test them in your container.
The container code also features a pull and push command to keep it in sync with a git repository.
@ngineered
Putting It All Together
https://registry.hub.docker.com/u/richarvey/nginx-php-fpm/
Running the container from the cli:
$ docker run --name worpress_prod -e 'TEMPLATE_NGINX_HTML=0' -e 'GIT_REPO=git@github.com:xyz/wordpress.git' -e ‘GIT_BRANCH=master’ -e 'GIT_NAME=Ric Harvey' -e 'GIT_EMAIL=ric@ngineered.co.uk' -v /opt/wpdeploy/:/root/.ssh -p 9090:80 -d richarvey/nginx-php-fpm:mainline
90dc407d7b35acd8753023819cfaf03dfe247a544d2786922758ca8bb03ee1d2
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90dc407d7b35 richarvey/nginx-php-fpm:mainline "/bin/bash /start.sh 11 seconds ago Up 11 seconds 443/tcp, 0.0.0.0:9090->80/tcp wordpress_prod
@ngineered
WordPress + Cloud Services = Awesome Scale
@ngineered
Offloading Key Services
Why?
@ngineered
Amazon S3 and CloudFront Plugin
Description:
Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery.
Active Installs: 10,000+
Download:
https://wordpress.org/plugins/amazon-s3-and-cloudfront/
You’ll also need:
https://wordpress.org/plugins/amazon-web-services/
(PHP Libs for AWS)
@ngineered
WP Super Cache Plugin
Description:
A very fast caching engine for WordPress that produces static html files.
Active Installs: 1+ million
Download:
https://wordpress.org/plugins/wp-super-cache/
@ngineered
Disqus Plugin
Description:
The Disqus comment system replaces your WordPress comment system with your comments hosted and powered by Disqus.
Active Installs: 200,000+
Download:
https://wordpress.org/plugins/disqus-comment-system/
@ngineered
Google Plugin
Description:
This plugin gives a very simple way to integrate Google Search into your WordPress site.
Active Installs: 3,000+
Download:
https://wordpress.org/plugins/wp-google-search/
@ngineered
WP SES Plugin
Description:
WP-SES redirects all outgoing WordPress emails through Amazon Simple Email Service (SES) for maximum email deliverability.
Active Installs: 2,000+
Download:
https://wordpress.org/plugins/wp-ses/
@ngineered
HyperDB Plugin
Description:
HyperDB is an advanced database class that supports replication, failover, load balancing, and partitioning.
Active Installs: Less than 10
Download:
https://wordpress.org/plugins/hyperdb/
@ngineered
RDS
Benefits
Read Slaves
MySQL as a Service
@ngineered
Pull/Push Changes
https://registry.hub.docker.com/u/richarvey/nginx-php-fpm/
Push changes to Git:
$ docker exec -t -i wordpress_prod /usr/bin/push
Update the other running containers:
$ docker exec -t -i wordpress_prod /usr/bin/pull
@ngineered
Next Steps
http://kubernetes.io/
Schedulers for docker:
Service Discovery:
@ngineered
@ngineered