SlideShare a Scribd company logo
1 of 17
Download to read offline
WORDPRESS AND CONTAINERS
ALAN LOK
WHAT ARE CONTAINERS
Self-contained
• Single file with
system library
and application
code
• Lightweight
Immutable
• Portable,
predictable,
repeatable
infrastructure
Scalable
• Need more
power? Add
more
containers*
CONTAINER
MANAGEMENT
• Containers need a home (or
vessel) to carry its load
• Your solution will likely
need different containers
(database, app, API?)
• Lots of management or
orchestration tools to pick
• Kubernetes, Docker Swarm,
Mesos, Openshift, ECS to
name a few
THE LAMP STACK
Linux Apache PHP MySQL
THE “ALL-IN-ONE” WORDPRESS LAMP STACK
Linux
Hosting
(VPS /
Bare-
metal)
•Apache
•MySQL
•PHP
WORDPRESS IN DOCKER TERMS
Web
& PHP
WordPress
MySQL
Server
MySQL
WHY START WITH DOCKER?
• Docker is a very popular container format
• Immutable infrastructure
• Your application and its environment will be consistent and run similarly - whether it’s with
developer Jane, John or Janice
• Hosting mobility
• Deploy with any provider that takes an Docker image (including AWS, Azure, and Google)
• Separating code and data
• You can mount data to a data volume or path
WordPress Docker
Image (Apache/PHP)
127.0.0.2
Memcached Docker
127.0.0.4
Database Docker
(MySQL/mariaDB)
127.0.0.3
/var/www/wp-content/
uploads
/var/lib/mysql
TCP/3306
TCP/11211
A SIMPLE
DOCKERIZED
WORDPRESS VPS
• Single container host with
shared file mounts for user
data
• Each layer can change as you
need to update versions of
middleware or code
• This is possible with any VPS
or development workstation
DOCKER DEMO
version: '3.1'
services:
wordpress:
image: wordpress:latest
ports:
- 8080:80
environment:
WORDPRESS_DB_PASSWORD: password
volumes:
- wpcontent:/var/www/html/wp-content
mysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- wpdb:/var/lib/mysql
volumes:
wpdb:
driver: local
wpcontent:
driver: local
Step 1 – pull Docker images
docker pull wordpress
docker pull mysql
Step 2 – create stack.yml (see right)
Step 3 – run the stack
docker stack deploy -c
styack.yml wordpress
HOW ABOUT
• Making tweaks to your docker
image?
docker container ls
docker exec -i -t <id>
/bin/bash
• Shutting down the deployment?
• Cloning data / editing
docker cp <source> <dest>
• Save docker image?
docker container commit
<id> <rep>:<tag>
BUT WHAT ABOUT?
HIGH AVAILABILITY SCALING
My WordPress plugin needs lots of
processing power
It’s complicated…It can’t be down at all!
ORCHESTRATION
DOCKER ORCHESTRATION TO THE RESCUE
• Break your layers to more
manageable containers
• Use orchestration to handle service
discovery and expansion
• Have more than 1 container hosts
• Can mitigate some single points of
failure with LB or RR-DNS
Varnish Haproxy/LB
Apache*/
php-fpm MySQL
memcached
SCALING WORDPRESS
BY COMPONENT CONTAINERIZED
CDN/WAF
Container HostsNFS Mount
HTTP/HTTPS
TCP/2049
Orchestration Host
CDN/WAF
Load Balancer
PHP Servers
NFS Mount
MySQL Master MySQL Replica
Memcache cluster
TCP/3306
TCP/3306
TCP/11211
HTTP/HTTPS
HTTP
TCP/2049
USING GOOGLE CLOUD COMPUTE
USING AMAZON WEB SERVICES
Amazon ECS
Application Load
Balancer
EFS shareRDS DB instance
RDS DB instance
standby (multi-AZ)
CONSIDERATIONS FOR BETTER-SCALED
DOCKERIZED WORDPRESS
• Lock out plugin and WP auto-upgrades (use Docker images)
• Send wp-uploads using media library plugins (S3, Azure, GCP)
• Use orchestration for service discovery
• Multiple container hosts for resiliency
THANK YOU!
@alan_lok

More Related Content

What's hot

What's hot (20)

Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2
 
HashiCorp at Just Eat
HashiCorp at Just EatHashiCorp at Just Eat
HashiCorp at Just Eat
 
Containerization in microsoft azure
Containerization in microsoft azureContainerization in microsoft azure
Containerization in microsoft azure
 
AWS Lambda at JUST EAT
AWS Lambda at JUST EATAWS Lambda at JUST EAT
AWS Lambda at JUST EAT
 
Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2Hashicorp @ JUST EAT - Part 2
Hashicorp @ JUST EAT - Part 2
 
PaaS on top of CloudStack
PaaS on top of CloudStackPaaS on top of CloudStack
PaaS on top of CloudStack
 
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
Docker on AWS with Amazon ECR & ECS - Pop-up Loft Tel Aviv
 
Windows Azure Blob Storage
Windows Azure Blob StorageWindows Azure Blob Storage
Windows Azure Blob Storage
 
Terraform day 1
Terraform day 1Terraform day 1
Terraform day 1
 
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
 
AWS Elastic Container Service - DockerHN
AWS Elastic Container Service - DockerHNAWS Elastic Container Service - DockerHN
AWS Elastic Container Service - DockerHN
 
Amazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep DiveAmazon EC2 Container Service: Deep Dive
Amazon EC2 Container Service: Deep Dive
 
No Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with AnsibleNo Docker? No Problem: Automating installation and config with Ansible
No Docker? No Problem: Automating installation and config with Ansible
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
AWS December 2015 Webinar Series - Continuous Delivery to Amazon EC2 Containe...
 
GlobalAzureBootCamp 2018
GlobalAzureBootCamp 2018GlobalAzureBootCamp 2018
GlobalAzureBootCamp 2018
 
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de ZaragozaDocker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
 
Structured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, AccentureStructured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, Accenture
 
DockerCon SF 2015: Networking Breakout
DockerCon SF 2015: Networking BreakoutDockerCon SF 2015: Networking Breakout
DockerCon SF 2015: Networking Breakout
 

Similar to Word press and containers

Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
Docker, Inc.
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
Docker, Inc.
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
javaonfly
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
BlueData, Inc.
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 

Similar to Word press and containers (20)

Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and Microservice
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
State of the Container Ecosystem
State of the Container EcosystemState of the Container Ecosystem
State of the Container Ecosystem
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Docker and CloudStack
Docker and CloudStackDocker and CloudStack
Docker and CloudStack
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
Lessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker ContainersLessons Learned Running Hadoop and Spark in Docker Containers
Lessons Learned Running Hadoop and Spark in Docker Containers
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
How Reconnix Is Using Docker
How Reconnix Is Using DockerHow Reconnix Is Using Docker
How Reconnix Is Using Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
Docker 101 for Oracle DBAs - Oracle OpenWorld 2017
 

More from wcto2017

More from wcto2017 (20)

Word camp toronto 2017 secrets to a successful website building business fi...
Word camp toronto 2017   secrets to a successful website building business fi...Word camp toronto 2017   secrets to a successful website building business fi...
Word camp toronto 2017 secrets to a successful website building business fi...
 
Better social wp_wcto
Better social wp_wctoBetter social wp_wcto
Better social wp_wcto
 
Creating word press community with the human voice
Creating word press community with the human voiceCreating word press community with the human voice
Creating word press community with the human voice
 
New programs-17-09-29
New programs-17-09-29New programs-17-09-29
New programs-17-09-29
 
Wordcamp 2017-toronto-sam lalonde
Wordcamp 2017-toronto-sam lalondeWordcamp 2017-toronto-sam lalonde
Wordcamp 2017-toronto-sam lalonde
 
Word camp ga 2017 4
Word camp ga 2017   4Word camp ga 2017   4
Word camp ga 2017 4
 
Woo commerce fundamentals
Woo commerce fundamentalsWoo commerce fundamentals
Woo commerce fundamentals
 
Navigating the censored web wcto
Navigating the censored web   wctoNavigating the censored web   wcto
Navigating the censored web wcto
 
Becoming knownwcto1
Becoming knownwcto1Becoming knownwcto1
Becoming knownwcto1
 
Locol media mikepun wcto2017 v08
Locol media  mikepun  wcto2017 v08Locol media  mikepun  wcto2017 v08
Locol media mikepun wcto2017 v08
 
Leveling up on building forms
Leveling up on building formsLeveling up on building forms
Leveling up on building forms
 
Joshua wold
Joshua woldJoshua wold
Joshua wold
 
Word press beyond websites toronto
Word press  beyond websites torontoWord press  beyond websites toronto
Word press beyond websites toronto
 
Word camp toronto presentation centofanti
Word camp toronto presentation centofantiWord camp toronto presentation centofanti
Word camp toronto presentation centofanti
 
Website optimization through quality experimentation (2)
Website optimization through quality experimentation (2)Website optimization through quality experimentation (2)
Website optimization through quality experimentation (2)
 
Wp, uxd, and you
Wp, uxd, and youWp, uxd, and you
Wp, uxd, and you
 
Little Things Make a Difference - Michelle Ames
Little Things Make a Difference - Michelle AmesLittle Things Make a Difference - Michelle Ames
Little Things Make a Difference - Michelle Ames
 
Sass presentation
Sass presentationSass presentation
Sass presentation
 
9 step-seo-healthcheck-points-for-your-word press-website
9 step-seo-healthcheck-points-for-your-word press-website9 step-seo-healthcheck-points-for-your-word press-website
9 step-seo-healthcheck-points-for-your-word press-website
 
Oooh shiny
Oooh shinyOooh shiny
Oooh shiny
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Word press and containers

  • 2. WHAT ARE CONTAINERS Self-contained • Single file with system library and application code • Lightweight Immutable • Portable, predictable, repeatable infrastructure Scalable • Need more power? Add more containers*
  • 3. CONTAINER MANAGEMENT • Containers need a home (or vessel) to carry its load • Your solution will likely need different containers (database, app, API?) • Lots of management or orchestration tools to pick • Kubernetes, Docker Swarm, Mesos, Openshift, ECS to name a few
  • 4. THE LAMP STACK Linux Apache PHP MySQL
  • 5. THE “ALL-IN-ONE” WORDPRESS LAMP STACK Linux Hosting (VPS / Bare- metal) •Apache •MySQL •PHP
  • 6. WORDPRESS IN DOCKER TERMS Web & PHP WordPress MySQL Server MySQL
  • 7. WHY START WITH DOCKER? • Docker is a very popular container format • Immutable infrastructure • Your application and its environment will be consistent and run similarly - whether it’s with developer Jane, John or Janice • Hosting mobility • Deploy with any provider that takes an Docker image (including AWS, Azure, and Google) • Separating code and data • You can mount data to a data volume or path
  • 8. WordPress Docker Image (Apache/PHP) 127.0.0.2 Memcached Docker 127.0.0.4 Database Docker (MySQL/mariaDB) 127.0.0.3 /var/www/wp-content/ uploads /var/lib/mysql TCP/3306 TCP/11211 A SIMPLE DOCKERIZED WORDPRESS VPS • Single container host with shared file mounts for user data • Each layer can change as you need to update versions of middleware or code • This is possible with any VPS or development workstation
  • 9. DOCKER DEMO version: '3.1' services: wordpress: image: wordpress:latest ports: - 8080:80 environment: WORDPRESS_DB_PASSWORD: password volumes: - wpcontent:/var/www/html/wp-content mysql: image: mysql:latest environment: MYSQL_ROOT_PASSWORD: password volumes: - wpdb:/var/lib/mysql volumes: wpdb: driver: local wpcontent: driver: local Step 1 – pull Docker images docker pull wordpress docker pull mysql Step 2 – create stack.yml (see right) Step 3 – run the stack docker stack deploy -c styack.yml wordpress
  • 10. HOW ABOUT • Making tweaks to your docker image? docker container ls docker exec -i -t <id> /bin/bash • Shutting down the deployment? • Cloning data / editing docker cp <source> <dest> • Save docker image? docker container commit <id> <rep>:<tag>
  • 11. BUT WHAT ABOUT? HIGH AVAILABILITY SCALING My WordPress plugin needs lots of processing power It’s complicated…It can’t be down at all! ORCHESTRATION
  • 12. DOCKER ORCHESTRATION TO THE RESCUE • Break your layers to more manageable containers • Use orchestration to handle service discovery and expansion • Have more than 1 container hosts • Can mitigate some single points of failure with LB or RR-DNS Varnish Haproxy/LB Apache*/ php-fpm MySQL memcached
  • 13. SCALING WORDPRESS BY COMPONENT CONTAINERIZED CDN/WAF Container HostsNFS Mount HTTP/HTTPS TCP/2049 Orchestration Host CDN/WAF Load Balancer PHP Servers NFS Mount MySQL Master MySQL Replica Memcache cluster TCP/3306 TCP/3306 TCP/11211 HTTP/HTTPS HTTP TCP/2049
  • 15. USING AMAZON WEB SERVICES Amazon ECS Application Load Balancer EFS shareRDS DB instance RDS DB instance standby (multi-AZ)
  • 16. CONSIDERATIONS FOR BETTER-SCALED DOCKERIZED WORDPRESS • Lock out plugin and WP auto-upgrades (use Docker images) • Send wp-uploads using media library plugins (S3, Azure, GCP) • Use orchestration for service discovery • Multiple container hosts for resiliency