Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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.

91029e75bc84656f1afe732d2b2dfa86?s=128

Stefan van Gastel

June 09, 2017
Tweet

Transcript

  1. CAKEPHP IN A CONTAINERIZED CI/CD ENVIRONMENT

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

    ▸ Netherlands ▸ Zundert ▸ Vincent van Gogh ▸ Flower parade ▸ CakePHP since 1.2 ▸ CakeFest since 2012 2
  3. 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
  4. WHO IS THIS GUY? Not this kind of guy… More

    like this guy… 4
  5. 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
  6. 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
  7. CONTAINERS CAN RUN ON ANY LINUX BASED OS AND WINDOWS

    SERVER 2016 Source: https://docker.com 7
  8. USAGE WITHIN THE MOD USING CONTAINERS 8 DOCKER FOR OVER

    10 YEARS
  9. BRACE YOURSELF WARNING! Everything we build and run is in

    an offline, on-premise intranet infrastructure. 9
  10. CAKEPHP WHERE DOES CAKEPHP FIT IN? 10

  11. 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
  12. PRODUCTION HOW OUR CAKE GETS EATEN Event Same old sh*t

    12
  13. LESSONS LEARNED 1 OF 3 MINDSET 13

  14. 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
  15. LESSONS LEARNED 2 OF 3 12 FACTOR APPS III. Config

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

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

    Maximize robustness with fast startup and graceful shutdown 17
  18. LESSONS LEARNED 3 OF 3 CONTAINERS ARE REVOLUTION, NOT EVOLUTION

    18
  19. LESSONS LEARNED 3 OF 3 CONTAINERS ARE REVOLUTION, NOT EVOLUTION

    19
  20. CAKEPHP AND DOCKER DEMO

  21. 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/
  22. BE HONEST ANY QUESTIONS? $ docker run -i answers:latest ▸

    Feedback ▸ https://joind.in/talk/095fd ▸ Contact me ▸ stefanvangastel@gmail.com / scwj.v.gastel@mindef.nl ▸ https://www.linkedin.com/in/stefan-van-gastel ▸ Slides ▸ https://speakerdeck.com/stefanvangastel/cakephp-in-a-containerized-ci-cd-environment