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

PPTX
EMEA Airheads- AirGroup profiling changes across 8.1 & 8.2 – ArubaOS 8.x
PPTX
EMEA Airheads - Aruba Remote Access Point (RAP) Troubleshooting
PDF
RAP Networks Validated Reference Design
PPTX
Introduction to OOP(in java) BY Govind Singh
PPT
Polymorphism
PDF
Dockers and kubernetes
PDF
Quick introduction to scala
PDF
EMEA Airheads- AirGroup profiling changes across 8.1 & 8.2 – ArubaOS 8.x
EMEA Airheads - Aruba Remote Access Point (RAP) Troubleshooting
RAP Networks Validated Reference Design
Introduction to OOP(in java) BY Govind Singh
Polymorphism
Dockers and kubernetes
Quick introduction to scala

What's hot (14)

PPTX
Lecture - 5 Control Statement
PPTX
Java arrays
PDF
An introduction to mobile app development and investing
PDF
PDF
Finding Bugs Faster with Assertion Based Verification (ABV)
PPTX
Java(Polymorphism)
PPTX
Factory Design Pattern
PPSX
Arrays in Java
PPT
Eclipse IDE
PDF
Method overloading, recursion, passing and returning objects from method, new...
PPTX
PDF
Symfony in microservice architecture
PDF
Code Coverage Revised : EclEmma on JaCoCo
PPTX
Hybrid inheritance
Lecture - 5 Control Statement
Java arrays
An introduction to mobile app development and investing
Finding Bugs Faster with Assertion Based Verification (ABV)
Java(Polymorphism)
Factory Design Pattern
Arrays in Java
Eclipse IDE
Method overloading, recursion, passing and returning objects from method, new...
Symfony in microservice architecture
Code Coverage Revised : EclEmma on JaCoCo
Hybrid inheritance
Ad

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

PPTX
The Future of Web Application Architectures
PDF
Docker interview Questions-3.pdf
PDF
"Wie passen Serverless & Autonomous zusammen?"
PPTX
Docker Introduction
PPTX
Weave User Group Talk - DockerCon 2017 Recap
PDF
Orchestrating Microservices with Kubernetes
PPTX
StrongLoop Overview
PDF
How to install and use Kubernetes
PDF
DevOPS training - Day 1/2
PPTX
How to Install and Use Kubernetes by Weaveworks
PPSX
Docker presentation
PPTX
Deploying windows containers with kubernetes
PPTX
DockerCon 16 General Session Day 1
PPTX
Introduction to Docker
PDF
Kalnai_Jirkal-vb-2016-malicious-osx-cocktail
PDF
Virus Bulletin 2016: A Malicious OS X Cocktail Served from a Tainted Bottle
PPTX
Cont0519
PPT
Amazon Web Services and Docker
PDF
Celery: The Distributed Task Queue
PPTX
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
The Future of Web Application Architectures
Docker interview Questions-3.pdf
"Wie passen Serverless & Autonomous zusammen?"
Docker Introduction
Weave User Group Talk - DockerCon 2017 Recap
Orchestrating Microservices with Kubernetes
StrongLoop Overview
How to install and use Kubernetes
DevOPS training - Day 1/2
How to Install and Use Kubernetes by Weaveworks
Docker presentation
Deploying windows containers with kubernetes
DockerCon 16 General Session Day 1
Introduction to Docker
Kalnai_Jirkal-vb-2016-malicious-osx-cocktail
Virus Bulletin 2016: A Malicious OS X Cocktail Served from a Tainted Bottle
Cont0519
Amazon Web Services and Docker
Celery: The Distributed Task Queue
CloudStack DC Meetup - Apache CloudStack Overview and 4.1/4.2 Preview
Ad

Recently uploaded (20)

PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Online Work Permit System for Fast Permit Processing
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
top salesforce developer skills in 2025.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administration Chapter 2
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
AI in Product Development-omnex systems
PPTX
L1 - Introduction to python Backend.pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
history of c programming in notes for students .pptx
PPTX
Introduction to Artificial Intelligence
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
PTS Company Brochure 2025 (1).pdf.......
Understanding Forklifts - TECH EHS Solution
Online Work Permit System for Fast Permit Processing
How Creative Agencies Leverage Project Management Software.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
top salesforce developer skills in 2025.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administration Chapter 2
VVF-Customer-Presentation2025-Ver1.9.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Design an Analysis of Algorithms I-SECS-1021-03
AI in Product Development-omnex systems
L1 - Introduction to python Backend.pptx
Softaken Excel to vCard Converter Software.pdf
history of c programming in notes for students .pptx
Introduction to Artificial Intelligence
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Operating system designcfffgfgggggggvggggggggg
PTS Company Brochure 2025 (1).pdf.......

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