PHP MEETS DOCKER A WHALE AND AN ELEPHANT

A WHALE AND AN ELEPHANT WHO AM I? I’m Steve McDougall ‣ ‣ ‣ ‣ PHP User Group Organiser Conference Organiser Experienced Developer PHP Advocate

A MODERN WORKFLOW FOR PHP DEVELOPERS

A WHALE AND AN ELEPHANT LETS START SIMPLE At this point frameworks aren’t important For this talk I will use Laravel as it has an easy installer

A WHALE AND AN ELEPHANT INTRODUCING DOCKER There are many ways to add Docker to your PHP projects, for this talk I will be using DDEV

A WHALE AND AN ELEPHANT SET UP ENVIRONMENTS IN MINUTES; SWITCH CONTEXTS AND PROJECTS QUICKLY; SPEED YOUR TIME TO DEPLOYMENT DDEV

A WHALE AND AN ELEPHANT WHAT IS DDEV DDEV is an amazing little tool to add Docker into any PHP application, with a great command line and easy to use configuration it is my go to for containers.

A WHALE AND AN ELEPHANT LETS ADD IT TO OUR APP

WE DID IT! With one line we added Docker to out application

HOW DO WE CONFIGURE DDEV

A WHALE AND AN ELEPHANT LETS START OUR APPLICATION

ONTO CI/CD

A WHALE AND AN ELEPHANT TESTING We all know Laravel has a nice testing suite, so let’s add some very basic tests, to prove a point.

A WHALE AND AN ELEPHANT NEXT STOP: GITLAB Next stop is to get all this magic up on GitLab. We all know how git works, so fast forward a couple of minutes.

A WHALE AND AN ELEPHANT TIME TO CONFIGURE OUR SERVER

A WHALE AND AN ELEPHANT GITLAB NEEDS TO KNOW ABOUT OUR PRIVATE KEY

A WHALE AND AN ELEPHANT MAKE SURE TO ADD IT TO YOUR REPO!

A WHALE AND AN ELEPHANT CONFIGURE NGINX

ENTER ENVOY

A WHALE AND AN ELEPHANT LARAVEL ENVOY PROVIDES A CLEAN, MINIMAL SYNTAX FOR DEFINING COMMON TASKS YOU RUN ON YOUR REMOTE SERVERS. Laravel Envoy

A WHALE AND AN ELEPHANT ▸ Tasks: Tasks are commands to be ran on your remote server ▸ Stories: Stories are groups of tasks ▸ Notifications: Send notifications to Slack or Discord

A WHALE AND AN ELEPHANT MANAGING RELEASES Envoy has a useful setup directive, which allows you to set initial variables to use.

GITLAB: CONTAINER REPOSITORY

A WHALE AND AN ELEPHANT CREATE A .GITLAB-CI.YML TO MANAGE THE PROCESS

TEXT CI/CD IS EASIER THAN YOU THINK, AND WITH LOADS OF TOOLS OUT THERE YOU HAVE NO EXCUSE NOT TO USE THEM Steve McDougall

GitHub: JustSteveKing Twitter: @JustSteveKing THANK YOU FOR LISTENING