Slide 1

Slide 1 text

CAKEPHP IN A CONTAINERIZED CI/CD ENVIRONMENT

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

WHO IS THIS GUY? Not this kind of guy… More like this guy… 4

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

CONTAINERS CAN RUN ON ANY LINUX BASED OS AND WINDOWS SERVER 2016 Source: https://docker.com 7

Slide 8

Slide 8 text

USAGE WITHIN THE MOD USING CONTAINERS 8 DOCKER FOR OVER 10 YEARS

Slide 9

Slide 9 text

BRACE YOURSELF WARNING! Everything we build and run is in an offline, on-premise intranet infrastructure. 9

Slide 10

Slide 10 text

CAKEPHP WHERE DOES CAKEPHP FIT IN? 10

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

PRODUCTION HOW OUR CAKE GETS EATEN Event Same old sh*t 12

Slide 13

Slide 13 text

LESSONS LEARNED 1 OF 3 MINDSET 13

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

LESSONS LEARNED 2 OF 3 12 FACTOR APPS III. Config | Store config in the environment 15

Slide 16

Slide 16 text

LESSONS LEARNED 2 OF 3 12 FACTOR APPS IV. Backing services | Treat backing services as attached resources 16

Slide 17

Slide 17 text

LESSONS LEARNED 2 OF 3 12 FACTOR APPS IX. Disposability Maximize robustness with fast startup and graceful shutdown 17

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

CAKEPHP AND DOCKER DEMO

Slide 21

Slide 21 text

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/

Slide 22

Slide 22 text

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