Workshop presentation

Preview:

Citation preview

How to Deploy Web Apps with Docker Daniël van Gils / Developer Advocate

daniel@cloud66.com

@foldingbeauty

I like to build stuffTinkering with techCreate great UX

agenda

• Introduction + setting up development machine - 30’ • Hands-on ‘dev-x’ session - 30’ • Comfort break - 10’ • Docker in production using Cloud 66 - 10’ • Hands-on ‘x-ops’ session - 45’ • Wrap-up & Q+A - 10’

housekeeping notesFor the workshop, you’ll need:

• A laptop or pair-workshopping • Your Github login • Your Cloud 66 account • A DigitalOcean account

(Please use Promo Code: CLOUD66, to receive a $10 Credit)

Toilets around the counter left and take a right ;-)

mix matchtech

workflow

dev ops

development production

part 1 workshop part 2 workshop

container definitions

servers

stack

service(s)

container(s)

image(s)codebase

datasources

tools being used

ssh docker

docker-compose text editor

git cx

containers for the win

• mix-match technology • rapid prototyping • polyglot approach / choosing the right

development framework for the right job

containers primer

app java

app nodejs

dependencies

server server

docker

dependenciesapp java dependencies

app nodejs

server

app java

app java

app nodejs

app nodejs

dependencies

setting up the your development machine in

the cloud

• Steps 1 - 7 (building takes 10 minutes)

Step1: create DigitalOcean account

go to https://cloud.digitalocean.com/registrations/new

and create a new account

Please use Promo Code: CLOUD66, to receive a $10 Credit.

Step 2: create Cloud 66 account

go to https://app.cloud66.com/users/sign_up and create a new account

Step 3: create a remote

development machinego to https://cloud.digitalocean.com/droplets/new

use the One-click App tab choose Docker 1.10.3 on 14:04

choose size $40/monthregion London

press create you’ll get the login information mailed to you

Step 4: log into development

machinessh to your new server

open terminal

use the password in the DigitalOcean emailyou will be asked to change your password

$ssh root@<your ip>

Step 5: install docker-compose

output should be : docker-compose version: 1.6.2

$curl -L https://github.com/docker/compose/releases/download/1.6.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose$chmod +x /usr/local/bin/docker-compose$docker-compose —version

Step 6: fork the bakery example

and pull the code

go to Github.comfork https://github.com/cloud66-samples/microservices_101

create a a home-directory for the app

pull the code

$mkdir /home/app$cd /home/app

$git clone https://github.com/<your github account>/microservices_101

go to the bakery/bricksandmortar folder

and change the IP address (of your new server) of the API to be used

Step 6½: change the ip

$vi /home/app/microservices_101/bakery/bricksandmortar/Dockerfile.development

ENV COUNTER_ADDRESS <your ip address>:8000

Step 7: build all the images

$ cd /home/app/microservices_101/bakery

go to the bakery folder

build all the images (takes approx. 10 minutes)

$docker-compose build

bricksandmortar

counter

chef

Best Bakery

picker

baker minions (bagel, doughnut, spacecakes)

accountant

Frontend

(static)

API

(ruby)

CMS

Workers node.js

Php Java

very special μservice bakery

bricksandmortar

counter

chef

Best Bakery

picker

baker minions (bagel, doughnut, spacecakes)

accountant

Frontend

(static)

API

(ruby)

CMS

Workers node.js

Php Java

very special μservice bakery

Who we Are?

• Founded in 2011 • Specialist in DevOps-as-a-Service • Help developers build, deploy & manage apps • Any server and any cloud provider of choice • A single, integrated toolkit (UI and CLI) • 7k developers, 8k companies, 4k apps, 78 data centres

2 products: Cloud 66 for Docker + Cloud 66 for Rails

Cloud 66 for Docker in production

• Running Docker in production for customers since Jan 2015 • Cloud 66 for Docker used by >500 companies • 870 Docker production servers • 1,176 Docker production stacks

is Docker in production hard?

security monitoring

datasources backups storage

orchestration scaling

clustering automation

service discovery

note • We use service.yml (looks like docker-compose.yml) to tell which

services need to be running on our Docker cluster.

• We have a tool called starter to ‘containerize’ existing codebases or use the bakery example as a starting point.

• http://help.cloud66.com/building-your-stack/cloud-66-starter

wrap-up • Thanks for your attention • And thanks to Digital Ocean for sponsoring some CPU power • And thanks to WeWork for the nice workshop space • Any questions? • Don’t forget about your running servers ;-)