How to Dockerize a PHP application

PHP Conference Asia 2016

Kai Hendry

Post lunch tutorial

2.5 hrs of knowledge transfer

1. Intro - ~30mins
2. We do a Docker tutorial together ~1hr
3. We try Dockerize your stuff ~1hr
4. BONUS: AWS ECS zero downtime

Ask me questions at any time!

About me

Docker doings:

So what is Docker?

A defacto standard in the world of containers built by the company dotCloud in
Golang leveraging LXC technology.

What is a container? A running image. Docker has a powerful image layering concept and a push/pull image store.

Why not use LXC? Docker provides a nice user interface.

Is it secure?

What makes Docker a "game changer"?

PHP tutorial

Overview

Containers are more like bricks

Actually usually you need to compose your containers

PHP pipeline, i.e. the way you deploy

1. git push
2. travis builds and uploads image to ECR
3. Update docker-compose.yml with image id
4. ecs-cli compose service up

OR

1. docker build -t myapp .
2. docker push myapp:id
3. Update docker-compose.yml with image id
4. ecs-cli compose service up

Tricky sides to Docker

Thank you