29
How to Deploy Web Apps with Docker Daniël van Gils / Developer Advocate [email protected] @foldingbeauty

Workshop presentation

Embed Size (px)

Citation preview

Page 1: Workshop presentation

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

[email protected]

@foldingbeauty

Page 2: Workshop presentation

I like to build stuffTinkering with techCreate great UX

Page 3: Workshop presentation

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’

Page 4: Workshop presentation

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 ;-)

Page 5: Workshop presentation

mix matchtech

Page 6: Workshop presentation

workflow

dev ops

development production

part 1 workshop part 2 workshop

Page 7: Workshop presentation

container definitions

servers

stack

service(s)

container(s)

image(s)codebase

datasources

Page 8: Workshop presentation

tools being used

ssh docker

docker-compose text editor

git cx

Page 9: Workshop presentation

containers for the win

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

development framework for the right job

Page 10: Workshop presentation

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

Page 11: Workshop presentation

setting up the your development machine in

the cloud

• Steps 1 - 7 (building takes 10 minutes)

Page 12: Workshop presentation

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.

Page 13: Workshop presentation

Step 2: create Cloud 66 account

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

Page 14: Workshop presentation

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

Page 15: Workshop presentation

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>

Page 16: Workshop presentation

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

Page 17: Workshop presentation

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

Page 18: Workshop presentation

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

Page 19: Workshop presentation

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

Page 20: Workshop presentation

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

Page 21: Workshop presentation

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

Page 22: Workshop presentation

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

Page 23: Workshop presentation

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

Page 24: Workshop presentation

is Docker in production hard?

security monitoring

datasources backups storage

orchestration scaling

clustering automation

service discovery

Page 25: Workshop presentation
Page 26: Workshop presentation
Page 27: Workshop presentation
Page 28: Workshop presentation

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

Page 29: Workshop presentation

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 ;-)