SlideShare a Scribd company logo
1 of 20
Download to read offline
12-Factor App with Docker
Ophélie Mauger
Consultante DevOps - Alter Way
Why twelve-factor app ?
● Maximum portability between environments
● Suitable for deployment on modern cloud platforms
● Scale up
● Minimize time and costs with automation
● Continuous deployment
Why docker can help ?
● Maximum portability between environments
● Suitable for deployment on modern cloud platforms
● Scale up
● Minimize time and costs with automation
● Continuous deployment
12 factor App with docker
step by step
codebase dependencies config backing services
build,
release, run
processes
port
binding
concurrency
disposability
dev/prod
parity
Logs
Admin processes
I. CodeBase
One codebase tracked in revision control
II. Dependencies
Explicitly declare & isolate dependencies
|||. Config
Store config in the environment
● Linux environment variables
● docker-compose can define env variables via env files
IV. Backing services
Treat backing services as attached
ressources
● Linux environment variables
● docker-compose can define env variables via env files
● docker allows you to link services together
V. Build, Release, Run
Strictly separate build and run stages
● docker build --pull -t sampleapi:1.0 .
● docker push sampleapi:1.0
● docker run sampleapi:1.0
VI. Processes
Execute the app as one or more stateless
processes
● docker enforces stateless processes
● Use volumes to persist data
Export services via port binding
VII. Port Binding
Docker Host
service network
container
http
container
php-fpm
container
mysql
port binding
VIII. Concurrency
Scale out via the process model
Docker Cluster
docker host docker host docker host
http php
worker worker
worker worker
http php
worker worker
worker worker
http php
worker worker
worker worker
Workload divercity
scale
IX. Disposability
Maximize robustness with fast startup and
graceful shutdown
● Container restart policies
● Orchestration with docker swarm
● Reverse proxy and load balancing with
services containers
X. Dev/Prod parity
Keep development, staging, and
production as similar as possible
● “build once, run anywhere”
● Same app images across DevOps stages
XI. Logs
Treat logs as event streams
Dev environment
Logs in container stdout
>docker logs -f …
>docker-compose logs -f
Ops environment
Log driver : fluentd
container fluentd
XII. Admin processes
Run Admin/management tasks as one of
processes
docker exec ….
And what about
continuous deployment ?
Continuous Delivery with Docker
Build stage :
● docker build --pull -t myregistry/myimage:$version
● docker push myregistry/myimage:$version
Continuous Deployment with docker
Deploy stage :
● Connect to the swarm (export DOCKER_HOST, ...)
● docker-compose pull
● docker-compose up -d
Conclusion
If you plan to do a twelve-factor app
use docker to make it

More Related Content

What's hot

#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...
#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...
#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...
Docker, Inc.
 
Achieving Developer Nirvana With Codename: BlueMix
Achieving Developer Nirvana With Codename: BlueMixAchieving Developer Nirvana With Codename: BlueMix
Achieving Developer Nirvana With Codename: BlueMix
Ryan Baxter
 

What's hot (20)

OpenShift Overview - Red Hat Open House 2017
OpenShift Overview - Red Hat Open House 2017OpenShift Overview - Red Hat Open House 2017
OpenShift Overview - Red Hat Open House 2017
 
Modern Application Development v1-0
Modern Application Development  v1-0Modern Application Development  v1-0
Modern Application Development v1-0
 
An Integrated Pipeline for Private and Public Clouds with Jenkins, Artifactor...
An Integrated Pipeline for Private and Public Clouds with Jenkins, Artifactor...An Integrated Pipeline for Private and Public Clouds with Jenkins, Artifactor...
An Integrated Pipeline for Private and Public Clouds with Jenkins, Artifactor...
 
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer DemandPaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
PaaS Lessons: Cisco IT Deploys OpenShift to Meet Developer Demand
 
The Twelve-Factor App
The Twelve-Factor AppThe Twelve-Factor App
The Twelve-Factor App
 
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
Putting The 'M' In MBaaS—Red Hat Mobile Client Development Platform (Jay Balu...
 
Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2
Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2
Puzzle ITC Talk @Docker CH meetup CI CD_with_Openshift_0.2
 
OpenShift Meetup 8th july 2019 at ConSol - OpenShift v4
OpenShift Meetup 8th july 2019 at ConSol - OpenShift v4OpenShift Meetup 8th july 2019 at ConSol - OpenShift v4
OpenShift Meetup 8th july 2019 at ConSol - OpenShift v4
 
Micro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factorsMicro services, reactive manifesto and 12-factors
Micro services, reactive manifesto and 12-factors
 
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
Red Hhat Summit 2017 : Love Containers, Love Devops, Love Openshift, Where's ...
 
DevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
DevOps Talks Melbourne 2018: Whales, Cats and KubernetesDevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
DevOps Talks Melbourne 2018: Whales, Cats and Kubernetes
 
#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...
#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...
#bigwhale: An Unexpected Journey into Containerization @ Lockheed Martin - Pa...
 
Boston Cloud Meetup - IBM Containers
Boston Cloud Meetup - IBM ContainersBoston Cloud Meetup - IBM Containers
Boston Cloud Meetup - IBM Containers
 
Openshift YARN - strata 2014
Openshift YARN - strata 2014Openshift YARN - strata 2014
Openshift YARN - strata 2014
 
DockerCon SF 2015: From Months to Minutes
DockerCon SF 2015: From Months to MinutesDockerCon SF 2015: From Months to Minutes
DockerCon SF 2015: From Months to Minutes
 
Future of Microservices - Jakub Hadvig
Future of Microservices - Jakub HadvigFuture of Microservices - Jakub Hadvig
Future of Microservices - Jakub Hadvig
 
DockerCon SF 2015: Beyond CI to Production Scale PaaS with Docker
DockerCon SF 2015: Beyond CI to Production Scale PaaS with DockerDockerCon SF 2015: Beyond CI to Production Scale PaaS with Docker
DockerCon SF 2015: Beyond CI to Production Scale PaaS with Docker
 
Achieving Developer Nirvana With Codename: BlueMix
Achieving Developer Nirvana With Codename: BlueMixAchieving Developer Nirvana With Codename: BlueMix
Achieving Developer Nirvana With Codename: BlueMix
 
Automation CI CD with Gitlab, Java, docker on Hidora - Jelastic
Automation CI CD with Gitlab, Java, docker on Hidora - JelasticAutomation CI CD with Gitlab, Java, docker on Hidora - Jelastic
Automation CI CD with Gitlab, Java, docker on Hidora - Jelastic
 
Deploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on KubernetesDeploying Spring Boot apps on Kubernetes
Deploying Spring Boot apps on Kubernetes
 

Viewers also liked

Viewers also liked (14)

Dev ops conf 2015 12 factor app - 2nd gen
Dev ops conf 2015   12 factor app - 2nd genDev ops conf 2015   12 factor app - 2nd gen
Dev ops conf 2015 12 factor app - 2nd gen
 
12 Factor App from Docker's Point of View
12 Factor App from Docker's Point of View12 Factor App from Docker's Point of View
12 Factor App from Docker's Point of View
 
CSA SV Threat detection and prediction
CSA SV Threat detection and predictionCSA SV Threat detection and prediction
CSA SV Threat detection and prediction
 
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
12-factor applications using WAS Liberty, IBM Bluemix, and Docker12-factor applications using WAS Liberty, IBM Bluemix, and Docker
12-factor applications using WAS Liberty, IBM Bluemix, and Docker
 
Workshop on CASB Part 2
Workshop on CASB Part 2Workshop on CASB Part 2
Workshop on CASB Part 2
 
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online MeetupIntroducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
 
JavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor App
 
Nanoservices and Microservices with Java
Nanoservices and Microservices with JavaNanoservices and Microservices with Java
Nanoservices and Microservices with Java
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
 
12-Factor
12-Factor12-Factor
12-Factor
 
Stop Hackers with Integrated CASB & IDaaS Security
Stop Hackers with  Integrated CASB & IDaaS SecurityStop Hackers with  Integrated CASB & IDaaS Security
Stop Hackers with Integrated CASB & IDaaS Security
 
12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment12 Factor App: Best Practices for JVM Deployment
12 Factor App: Best Practices for JVM Deployment
 
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
DevOps and Continuous Delivery Reference Architectures (including Nexus and o...
 
Cloud Foundry vs Docker vs Kubernetes - http://bit.ly/2rzUM2U
Cloud Foundry vs Docker vs Kubernetes - http://bit.ly/2rzUM2UCloud Foundry vs Docker vs Kubernetes - http://bit.ly/2rzUM2U
Cloud Foundry vs Docker vs Kubernetes - http://bit.ly/2rzUM2U
 

Similar to 12 FACTOR APP WITH DOCKER

Similar to 12 FACTOR APP WITH DOCKER (20)

Docker for dev
Docker for devDocker for dev
Docker for dev
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Pycon9 - Paas per tutti i gusti con Dokku and Kubernetes
Pycon9 - Paas per tutti i gusti con Dokku and KubernetesPycon9 - Paas per tutti i gusti con Dokku and Kubernetes
Pycon9 - Paas per tutti i gusti con Dokku and Kubernetes
 
Containers and Orchestration approaches
Containers and Orchestration approachesContainers and Orchestration approaches
Containers and Orchestration approaches
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
Run automated tests in Docker
Run automated tests in DockerRun automated tests in Docker
Run automated tests in Docker
 
Serverless Functions: Accelerating DevOps Adoption
Serverless Functions: Accelerating DevOps AdoptionServerless Functions: Accelerating DevOps Adoption
Serverless Functions: Accelerating DevOps Adoption
 
Cloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guideCloud-Native Drupal: a survival guide
Cloud-Native Drupal: a survival guide
 
Docker+java
Docker+javaDocker+java
Docker+java
 
Docker Overview - Rise of the Containers
Docker Overview - Rise of the ContainersDocker Overview - Rise of the Containers
Docker Overview - Rise of the Containers
 
Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015Red Hat Forum Benelux 2015
Red Hat Forum Benelux 2015
 
Docker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixDocker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & Bluemix
 
Introduction to Docker Container
Introduction to Docker ContainerIntroduction to Docker Container
Introduction to Docker Container
 
Developer Experience Cloud Native - Become Efficient and Achieve Parity
Developer Experience Cloud Native - Become Efficient and Achieve ParityDeveloper Experience Cloud Native - Become Efficient and Achieve Parity
Developer Experience Cloud Native - Become Efficient and Achieve Parity
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Adopting a PaaS Solution (Part 2) - Red Hat DevOps & Microservices Conference...
Adopting a PaaS Solution (Part 2) - Red Hat DevOps & Microservices Conference...Adopting a PaaS Solution (Part 2) - Red Hat DevOps & Microservices Conference...
Adopting a PaaS Solution (Part 2) - Red Hat DevOps & Microservices Conference...
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker - A high level introduction to dockers and containers
Docker - A high level introduction to dockers and containersDocker - A high level introduction to dockers and containers
Docker - A high level introduction to dockers and containers
 

More from TREEPTIK (12)

Streamline Devops workflows
Streamline Devops workflows Streamline Devops workflows
Streamline Devops workflows
 
How to build internet's hospital ?
How to build internet's hospital ? How to build internet's hospital ?
How to build internet's hospital ?
 
Realworld cd pipelines
Realworld cd pipelines Realworld cd pipelines
Realworld cd pipelines
 
CONTINUOUS DELIVERY HUBOT/KUBERNETES
CONTINUOUS DELIVERY HUBOT/KUBERNETESCONTINUOUS DELIVERY HUBOT/KUBERNETES
CONTINUOUS DELIVERY HUBOT/KUBERNETES
 
DOCKER@ORANGE SEASON 2
DOCKER@ORANGE SEASON 2DOCKER@ORANGE SEASON 2
DOCKER@ORANGE SEASON 2
 
DEVOPS, NOOPS QUEL FUTUR POUR LES OPS ?
DEVOPS, NOOPS QUEL FUTUR POUR LES OPS ?DEVOPS, NOOPS QUEL FUTUR POUR LES OPS ?
DEVOPS, NOOPS QUEL FUTUR POUR LES OPS ?
 
CONTINUOUS DELIVERY EN BANQUE
CONTINUOUS DELIVERY EN BANQUECONTINUOUS DELIVERY EN BANQUE
CONTINUOUS DELIVERY EN BANQUE
 
ACROPOLIS CONTAINER SERVICES
ACROPOLIS CONTAINER SERVICESACROPOLIS CONTAINER SERVICES
ACROPOLIS CONTAINER SERVICES
 
MAKE SENSE OF YOUR BIG DATA
MAKE SENSE OF YOUR BIG DATA MAKE SENSE OF YOUR BIG DATA
MAKE SENSE OF YOUR BIG DATA
 
DOCKER ET DEVOPS : ADOPTER LES MEMES PRATIQUES SOUS DEVOPS ET LINUX
DOCKER ET DEVOPS : ADOPTER LES MEMES PRATIQUES SOUS DEVOPS ET LINUXDOCKER ET DEVOPS : ADOPTER LES MEMES PRATIQUES SOUS DEVOPS ET LINUX
DOCKER ET DEVOPS : ADOPTER LES MEMES PRATIQUES SOUS DEVOPS ET LINUX
 
DOCKER AVEC RANCHER
DOCKER AVEC RANCHERDOCKER AVEC RANCHER
DOCKER AVEC RANCHER
 
DU DEVOPS AU FASTLAB
DU DEVOPS AU FASTLABDU DEVOPS AU FASTLAB
DU DEVOPS AU FASTLAB
 

Recently uploaded

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 

12 FACTOR APP WITH DOCKER

  • 1. 12-Factor App with Docker Ophélie Mauger Consultante DevOps - Alter Way
  • 2. Why twelve-factor app ? ● Maximum portability between environments ● Suitable for deployment on modern cloud platforms ● Scale up ● Minimize time and costs with automation ● Continuous deployment
  • 3. Why docker can help ? ● Maximum portability between environments ● Suitable for deployment on modern cloud platforms ● Scale up ● Minimize time and costs with automation ● Continuous deployment
  • 4. 12 factor App with docker step by step codebase dependencies config backing services build, release, run processes port binding concurrency disposability dev/prod parity Logs Admin processes
  • 5. I. CodeBase One codebase tracked in revision control
  • 6. II. Dependencies Explicitly declare & isolate dependencies
  • 7. |||. Config Store config in the environment ● Linux environment variables ● docker-compose can define env variables via env files
  • 8. IV. Backing services Treat backing services as attached ressources ● Linux environment variables ● docker-compose can define env variables via env files ● docker allows you to link services together
  • 9. V. Build, Release, Run Strictly separate build and run stages ● docker build --pull -t sampleapi:1.0 . ● docker push sampleapi:1.0 ● docker run sampleapi:1.0
  • 10. VI. Processes Execute the app as one or more stateless processes ● docker enforces stateless processes ● Use volumes to persist data
  • 11. Export services via port binding VII. Port Binding Docker Host service network container http container php-fpm container mysql port binding
  • 12. VIII. Concurrency Scale out via the process model Docker Cluster docker host docker host docker host http php worker worker worker worker http php worker worker worker worker http php worker worker worker worker Workload divercity scale
  • 13. IX. Disposability Maximize robustness with fast startup and graceful shutdown ● Container restart policies ● Orchestration with docker swarm ● Reverse proxy and load balancing with services containers
  • 14. X. Dev/Prod parity Keep development, staging, and production as similar as possible ● “build once, run anywhere” ● Same app images across DevOps stages
  • 15. XI. Logs Treat logs as event streams Dev environment Logs in container stdout >docker logs -f … >docker-compose logs -f Ops environment Log driver : fluentd container fluentd
  • 16. XII. Admin processes Run Admin/management tasks as one of processes docker exec ….
  • 18. Continuous Delivery with Docker Build stage : ● docker build --pull -t myregistry/myimage:$version ● docker push myregistry/myimage:$version
  • 19. Continuous Deployment with docker Deploy stage : ● Connect to the swarm (export DOCKER_HOST, ...) ● docker-compose pull ● docker-compose up -d
  • 20. Conclusion If you plan to do a twelve-factor app use docker to make it