$30 off During Our Annual Pro Sale. View Details »

CakePHP in a containerized CI-CD environment

CakePHP in a containerized CI-CD environment

A short talk about putting CakePHP in a (Docker) container environment for CI and CD purposes, what obstacles we have encountered doing that and what advantages it has provided us.

Stefan van Gastel

June 09, 2017
Tweet

Other Decks in Programming

Transcript

  1. WHO IS THIS GUY? STEFAN VAN GASTEL ▸ Age 32

    ▸ Netherlands ▸ Zundert ▸ Vincent van Gogh ▸ Flower parade ▸ CakePHP since 1.2 ▸ CakeFest since 2012 2
  2. WHO IS THIS GUY? STEFAN VAN GASTEL ▸ Dutch Ministry

    Of Defence (MOD) ▸ Since 2006 ▸ Technical lead ‘Mobile Apps Military Police’ ▸ Front-end ▸ Back-end ▸ Services ▸ Infrastructure ▸ Architecture 3
  3. CONTAINERS WHAT ARE CONTAINERS? Unlike VMs, containers do not bundle

    a full operating system - only libraries and settings required to make the software work are needed. This makes for efficient, lightweight, self-contained systems and guarantees that software will always run the same, regardless of where it’s deployed. Source: https://docker.com 5 Vary in: - Speed - Resource usage - Footprint - Isolation
  4. CONTAINERS WHAT IS DOCKER? Docker is the world’s leading software

    container platform. Developers use Docker to eliminate “works on my machine” Operators use Docker to run and manage apps side-by- side in isolated containers to get better compute density. Source: https://docker.com 6
  5. CONTAINERS CAN RUN ON ANY LINUX BASED OS AND WINDOWS

    SERVER 2016 Source: https://docker.com 7
  6. BRACE YOURSELF WARNING! Everything we build and run is in

    an offline, on-premise intranet infrastructure. 9
  7. CI/CD PIPELINES HOW OUR CAKE MOVES Development Commit & Push

    Gitlab Container Registry Test Qa Review / Staging Build Build & Push Pull & Test Pull & Check Pull & Deploy 11
  8. LESSONS LEARNED 2 OF 3 12 FACTOR APPS III. Config

    | Store config in the environment IV. Backing services | Treat backing services as attached resources IX. Disposability | Maximize robustness with fast startup and graceful shutdown https://12factor.net 14
  9. LESSONS LEARNED 2 OF 3 12 FACTOR APPS III. Config

    | Store config in the environment 15
  10. LESSONS LEARNED 2 OF 3 12 FACTOR APPS IV. Backing

    services | Treat backing services as attached resources 16
  11. LESSONS LEARNED 2 OF 3 12 FACTOR APPS IX. Disposability

    Maximize robustness with fast startup and graceful shutdown 17
  12. CAKEPHP AND DOCKER RESOURCES ▸ Examples ▸ https://github.com/stefanvangastel/docker-cakephp ▸ http://blog.danielcorreia.net/practical-docker-apache-php-and-

    mysql-cakephp-example/ ▸ https://hub.docker.com/r/occitech/cakephp/ ▸ Docker ▸ https://docs.docker.com/engine/userguide/eng-image/ dockerfile_best-practices/ ▸ https://blog.replicated.com/engineering/refactoring-a-dockerfile- for-image-size/
  13. BE HONEST ANY QUESTIONS? $ docker run -i answers:latest ▸

    Feedback ▸ https://joind.in/talk/095fd ▸ Contact me ▸ [email protected] / [email protected] ▸ https://www.linkedin.com/in/stefan-van-gastel ▸ Slides ▸ https://speakerdeck.com/stefanvangastel/cakephp-in-a-containerized-ci-cd-environment