SlideShare a Scribd company logo
Dockerize Me: Distributed PHP
applications with Symfony, Docker,
Consul and Ansible
Oleksii Petrov
Skelia Ukraine / ETwater Systems
skype: alexhelkar
twitter: @alexhelkar
email: alexhelkar@gmail.com
1. What for the goat needs
an accordion?
Agenda
Agenda (real)
1. SOA and Microservices
2. Dockerized infrastructure
3. Cluster Management
4. Service discovery and failure detection
5. Dockerizing Symfony Applications
SOA and Microservices:
7 days of app creation
Day 0 - In beginning was Word…
Day 1
www.example.com
Web server
Application
Database
Day 1. Evening
Day 2
www.example.com
Web server
Application Database
Cache
Day 3
www.example.com
Database
Application
Cache
Application
Cache
Web server
Day 4. Morning
DB Server Crash
Day 4. Night
www.example.com
DatabaseApplication
Cache
Application
Cache
Web server Database
Database
Database Cluster
Day 5
www.example.com
Database
Application
Cache
Application
Cache
Database
Database
Database Cluster
Web server
Cache
Web server
Cache
Web server
Cache
Day 6
Cache
Application
CRUD
Users
Authentication Notifications
API calls
to 3-rd
parties
Background
processing
A HA MOMENT
Day 7
www.example.com
Database
Database Cluster
Database Database
Users
Service
Authentication
and
Authorization
Service
Notification
Service
Crawler
Service
Parser
Service
Image
Resizer
Service
Report
Generation
Service
Application Cluster
Web server
Web server
Web server
Web Servers
Cluster
Cache
Cache
Cache Cluster
Core Idea
Process Component Microservice
Benefits
1. Individual scalability
2. Language/Framework independent
3. Small in general
(easier for a developer to understand)
4. Independent development and
deploy process per service
Dockerized
Infrastructure
Database
Database Cluster
Database Database
Users
Service
Authentication
and
Authorization
Service
Notification
Service
Crawler
Service
Parser
Service
Image
Resizer
Service
Report
Generation
Service
Application Cluster
Cache
Cache
Cache Cluster
MQ
MQ Cluster
MQ
ES
ElasticSearch Cluster
ES ESNginx
Web Servers Cluster
Nginx Nginx
Services - are all about Containers
Software Delivery (before)
Software Delivery (before)
The Game Changer
Software Delivery (now)
Software Delivery (now)
Software Delivery (now)
Dockerfile
(DSL)
Docker
Image
Docker
Container
App
App 2
App 3
1
2
3
Uniform Processing
Problems?
Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and Ansible
Where is my services?
Service Discovery
Tomcat
10.0.1.17:8080
RabbitMQ
10.0.1.171:5672
MongoDB
10.0.1.253:27017
API
10.0.1.11:80
Service Locator
10.0.1.17:8080 tomcat
10.0.1.171:5672 rabbitmq
10.0.1.253:27017 mongodb
10.0.1.11:3306 api
Looks familiar?
Own DNS?
Solution
Consul by HashiCorp
(consul.io)
Service Discovery
Service 4
Service 2
Service 3
Service 1
Service 1
Service 2
Service 3
Service 2
Service Discovery
Service 2
Service 2
Service 2
service2.service.consul
Service Discovery
DNS Masq Consul
External DNS
*.service.consul
Service Discovery
Cluster Management
Server 1
4 CPU & 16GB RAM
Server 2
8 CPU & 32GB RAM
Server 3
1 CPU & 8GB RAM
Server 4
2 CPU & 2GB RAM
Notification Service
API Service
Image Resizer
4xCPU
Reporting Service
2xRAM
Logger Service
User Service
Resources
(servers)
Services
(images)
Containers
(running)
2x
3x
10x
4x
1x
1x
Cluster Management
• ECS & ECR (Amazon)
• Kubernetes (Google)
• Nomad (HashiCorp)
• Mesos & Marathon (Apache)
Ansible
hosts: webservers
sudo: True
tasks:
- name: install nginx
apt: name=nginx update_cache=yes
- name: copy nginx config file
copy: src=files/nginx.conf dest=/etc/nginx/sites-available/default
- name: enable configuration
file: >
dest=/etc/nginx/sites-enabled/default
src=/etc/nginx/sites-available/default
state=link
- name: copy index.html
template: >
src=templates/index.html.j2
dest=/usr/share/nginx/html/index.html
mode=0644
- name: restart nginx
service: name=nginx state=restarted
Ansible Playbooks
Symfony Apps
with Docker
Symfony Apps with
Docker
Application Code
Webserver
Database
Cache
PHP-FPM Supervisord
• PHP-FPM
• Webserver
• Database
• Cache
Pitfalls with Docker
Questions?
Oleksii Petrov
Skelia Ukraine / ETwater Systems
skype: alexhelkar
twitter: @alexhelkar
email: alexhelkar@gmail.com
Welcome to Kiev PHP User Group

More Related Content

What's hot (20)

PDF
Convert Postman APIs collections to JMeter
Basant Dewangan
 
PDF
Docker vs kvm
Wilson Cunalata
 
PDF
Multi-tenant Database Design for SaaS
Võ Duy Tuấn
 
PDF
Deploy resources on Azure using IaC (Azure Terraform)
George Grammatikos
 
PDF
악성코드와 분석 방법
Youngjun Chang
 
PDF
How to Prepare for CKA Exam
Alfie Chen
 
PDF
DevOps, Common use cases, Architectures, Best Practices
Shiva Narayanaswamy
 
PDF
Alphorm.com Formation F5 BIG-IP DNS (anciennement GTM)
Alphorm
 
PDF
Credential store using HashiCorp Vault
Mayank Patel
 
PPTX
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Vietnam Open Infrastructure User Group
 
PDF
Consul
Ariel Moskovich
 
PDF
Software Engineering - chp8- deployment
Lilia Sfaxi
 
PDF
왕초보를 위한 도커 사용법
GeunCheolYeom
 
PPTX
Monitoramento e Gerenciamento de Infraestrutura com Zabbix - Patrícia Ladislau
Patricia Ladislau Silva
 
PPT
Aula 04 coneitos de auditoria de sistemas
sorayaNadja
 
PPTX
NSX_Troubleshooting.pptx
Dhruv Sharma
 
PDF
10 Key MongoDB Performance Indicators
iammutex
 
PPTX
DevSecOps
Joel Divekar
 
PPT
Asa sslvpn security
Jack Melson
 
PPTX
Mule memory leak issue
JeeHyunLim
 
Convert Postman APIs collections to JMeter
Basant Dewangan
 
Docker vs kvm
Wilson Cunalata
 
Multi-tenant Database Design for SaaS
Võ Duy Tuấn
 
Deploy resources on Azure using IaC (Azure Terraform)
George Grammatikos
 
악성코드와 분석 방법
Youngjun Chang
 
How to Prepare for CKA Exam
Alfie Chen
 
DevOps, Common use cases, Architectures, Best Practices
Shiva Narayanaswamy
 
Alphorm.com Formation F5 BIG-IP DNS (anciennement GTM)
Alphorm
 
Credential store using HashiCorp Vault
Mayank Patel
 
Ansible Automation - Enterprise Use Cases | Juncheng Anthony Lin
Vietnam Open Infrastructure User Group
 
Software Engineering - chp8- deployment
Lilia Sfaxi
 
왕초보를 위한 도커 사용법
GeunCheolYeom
 
Monitoramento e Gerenciamento de Infraestrutura com Zabbix - Patrícia Ladislau
Patricia Ladislau Silva
 
Aula 04 coneitos de auditoria de sistemas
sorayaNadja
 
NSX_Troubleshooting.pptx
Dhruv Sharma
 
10 Key MongoDB Performance Indicators
iammutex
 
DevSecOps
Joel Divekar
 
Asa sslvpn security
Jack Melson
 
Mule memory leak issue
JeeHyunLim
 

Similar to Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and Ansible (20)

PPTX
Microservices and containers for the unitiated
Kevin Lee
 
PDF
DockerCon SF 2015: Interconnecting Containers at Scale w/ NGINX
Docker, Inc.
 
PDF
ContainerDayVietnam2016: Dockerize a small business
Docker-Hanoi
 
PPTX
Ignite 2017 - Windows Server Feature Release
Taylor Brown
 
PPTX
This will show docker history details Ppt.pptx
KumarPalanisamy8
 
PDF
Alibaba Cloud Conference 2016 - Docker Enterprise
John Willis
 
PPTX
Interconnecting containers at scale #Dockercon
sarahnovotny
 
PPTX
The Future of Web Application Architectures
Lucas Carlson
 
PPTX
Introduction to Docker - 2017
Docker, Inc.
 
PDF
Shipping Applications to Production in Containers with Docker
Jérôme Petazzoni
 
PDF
Containers, microservices and serverless for realists
Karthik Gaekwad
 
PPT
Docker in the Wild
Christian Mague
 
PPT
Docker in the Wild
Chris Mague
 
PDF
DCEU 18: How To Build Your Containerization Strategy
Docker, Inc.
 
PDF
Chicago Docker Meetup Presentation - Mediafly
Mediafly
 
PDF
Alibaba Cloud Conference 2016 - Docker Open Source
John Willis
 
PDF
Docker in production service discovery with consul - road to opscon 2015
Giovanni Toraldo
 
PDF
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
PDF
Micro service, Containers & Cluster Management
Vasu Thiyagarajan
 
PPTX
Microservices in academic environment
Milind Bhagwati
 
Microservices and containers for the unitiated
Kevin Lee
 
DockerCon SF 2015: Interconnecting Containers at Scale w/ NGINX
Docker, Inc.
 
ContainerDayVietnam2016: Dockerize a small business
Docker-Hanoi
 
Ignite 2017 - Windows Server Feature Release
Taylor Brown
 
This will show docker history details Ppt.pptx
KumarPalanisamy8
 
Alibaba Cloud Conference 2016 - Docker Enterprise
John Willis
 
Interconnecting containers at scale #Dockercon
sarahnovotny
 
The Future of Web Application Architectures
Lucas Carlson
 
Introduction to Docker - 2017
Docker, Inc.
 
Shipping Applications to Production in Containers with Docker
Jérôme Petazzoni
 
Containers, microservices and serverless for realists
Karthik Gaekwad
 
Docker in the Wild
Christian Mague
 
Docker in the Wild
Chris Mague
 
DCEU 18: How To Build Your Containerization Strategy
Docker, Inc.
 
Chicago Docker Meetup Presentation - Mediafly
Mediafly
 
Alibaba Cloud Conference 2016 - Docker Open Source
John Willis
 
Docker in production service discovery with consul - road to opscon 2015
Giovanni Toraldo
 
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
Micro service, Containers & Cluster Management
Vasu Thiyagarajan
 
Microservices in academic environment
Milind Bhagwati
 
Ad

Recently uploaded (20)

PDF
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
PPTX
Introduction to web development | MERN Stack
JosephLiyon
 
PPTX
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
 
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
PDF
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
PDF
Rewards and Recognition (2).pdf
ethan Talor
 
PDF
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
 
PPTX
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
PDF
How DeepSeek Beats ChatGPT: Cost Comparison and Key Differences
sumitpurohit810
 
PDF
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
PPTX
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
PPTX
For my supp to finally picking supp that work
necas19388
 
PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
PPTX
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
PPTX
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
 
PDF
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PPTX
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
Cloud computing Lec 02 - virtualization.pdf
asokawennawatte
 
Introduction to web development | MERN Stack
JosephLiyon
 
Avast Premium Security crack 25.5.6162 + License Key 2025
HyperPc soft
 
IDM Crack with Internet Download Manager 6.42 Build 41
utfefguu
 
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Lionel Briand
 
WholeClear Split vCard Software for Split large vCard file
markwillsonmw004
 
Rewards and Recognition (2).pdf
ethan Talor
 
Alur Perkembangan Software dan Jaringan Komputer
ssuser754303
 
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
How DeepSeek Beats ChatGPT: Cost Comparison and Key Differences
sumitpurohit810
 
>Nitro Pro Crack 14.36.1.0 + Keygen Free Download [Latest]
utfefguu
 
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
For my supp to finally picking supp that work
necas19388
 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
IObit Driver Booster Pro 12.4-12.5 license keys 2025-2026
chaudhryakashoo065
 
Quality on Autopilot: Scaling Testing in Uyuni
Oscar Barrios Torrero
 
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
Ad

Dockerize Me: Distributed PHP applications with Symfony, Docker, Consul and Ansible