Deploying Web Apps with PaaS and Docker Tools

Preview:

DESCRIPTION

share why and when 42 Labs use Heroku or Dockerized Server Docker Hong Kong Meetup - Docker Hack Day 2014 Sharing

Citation preview

Deploying Web Apps

with PaaS

and Docker Tools

Docker Global Hacking Weekend

Eddie Lau (3dd13@42la.bs)

Me

Founder of 42 Labs (http://www.42la.bs)

Software Consultancy for Tech Startups

Online Portfolio

https://www.linkedin.com/in/3dd13

http://github.com/3dd13

http://3dd13.me

instead of telling what Docker is,

I will show you

why / when do we use it

Agenda

• Web Application Architecture

• Deploying Rails apps on Heroku.com

• Deploying Rails apps with Dokku

• Other Docker tools

Problem

publish my awesome Rails app

Solution

upload to a server

install libraries

EASY ?

Consideration

Q1: Where to deploy ?

Q1: Where to deploy ?

• a machine at your home / office ?

• a machine in Data Center ?

NO !!

use Cloud

Q2: How to deploy ?

we usually have

several 3-month-size projects

at the same time

a 3-month-size MVP project

can be like …

Web App Components

Web Application

(Ruby on Rails)

Web Frontend

(AngularJs)

Push Server

(Node.js)

Database

(PostgreSQL)Search Engine

(Elastic Search)Object Cache

(Redis)Static Asset

FilesApplication

Log

Server

Monitoring

Performance

Monitoring

On a Ubuntu server,

you may have to …

sudo apt-get update

sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3

libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libgdbm-dev libncurses5-dev automake

libtool bison libffi-dev …….

# install ruby

# install rails

# install nodejs

# setup postgresql

# init postgresql DB

# setup user account

# setup environment variables

# setup web server

# setup app server

If we have to do this

12+ times a year …

NO !!

use Automation

Q3: Who ?

Q4: What ?

Q5: When ?

if your team

is still setting up server manually

Change your company or

Change your company

Cloudify

to enhance

automation

Web App Components

Web Application

(Ruby on Rails)

Web Frontend

(AngularJs)

Push Server

(Node.js)

Database

(PostgreSQL)Search Engine

(Elastic Search)Object Cache

(Redis)Static Asset

FilesApplication

Log

Server

Monitoring

Performance

Monitoring

I don’t want to bother with

OTHER STUFF

Web App Components

Web Application

(Ruby on Rails)

Web Frontend

(AngularJs)

Push Server

(Node.js)

Database

(PostgreSQL)Search Engine

(Elastic Search)Object Cache

(Redis)Static Asset

FilesApplication

Log

Server

Monitoring

Performance

Monitoring

there are

Freemium Cloud services

out there

Web App Components

Web Application

(Ruby on Rails)

Web Frontend

(AngularJs)

Push Server

(Node.js)

Database

(PostgreSQL)Search Engine

(Elastic Search)Object Cache

(Redis)Static Asset

FilesApplication

Log

Server

Monitoring

Performance

Monitoring

Web App Components

Web Application

(Ruby on Rails)

Web Frontend

(AngularJs)

Push Server

(Node.js)

Database

(PostgreSQL)Search Engine

(Elastic Search)Object Cache

(Redis)Static Asset

FilesApplication

Log

Server

Monitoring

Performance

MonitoringPusher

RDS

Search Box

Redis To Go

Log Entries

s3

New RelicUptimeRobot

How about

coding runtime environment

setup?

PaaS

Demo: Heroku

• Generate new rails app

rails new docker-hk-meetup —database=postgresql

cd docker-hk-meetup

rails generate controller home index

• initialize git

git init

git add -A

git commit -m “initial commit”

• create a heroku app

heroku create docker-hk-meetup

• publish

git push heroku master

• available online !

heroku open

Heroku is awesome

BUT

you will grow to a point …

Expensive

Lost control

Slow

so How ?

Office

Machine

Data

Center

Cloud

ServerHeroku ?

I want my own server

with total control

but less hassle

Office

Machine

Data

Center

Cloud

ServerHeroku?

total control

but less hassle ?

Docker

Demo: Dokku

There are other advantages

than just automation too:

https://www.docker.com/whatisdocker/

We still use heroku heavily.

but for some growing projects,

we start using Docker

Docker Tools

PaaS

Dokku - private heroku

• https://github.com/progrium/dokku

Octohost - private heroku

• http://octohost.io/

Deis - like Dokku for server cluster

• https://github.com/deis/deis

Flynn - like Dokku for server cluster

• https://github.com/flynn/flynn

Dev Tools

Fig - Isolated development environment

• http://www.fig.sh/rails.html

• https://github.com/docker/fig

Docker Management

Interface

Panamax - Web interface

• http://panamax.io/

Manage Cluster

Serf - cluster membership by gossip notification

• https://www.serfdom.io/

• https://github.com/hashicorp/serf

Shipyard - Multi-host cluster Docker management

• http://shipyard-project.com/

• https://github.com/shipyard/shipyard

Questions ?

mailto:3dd13@42la.bs

https://www.linkedin.com/in/3dd13

http://github.com/3dd13

http://3dd13.me

Recommended