Contenu connexe Similaire à Deploying Web Apps with PaaS and Docker Tools (20) Deploying Web Apps with PaaS and Docker Tools1. Deploying Web Apps
with PaaS
and Docker Tools
Docker Global Hacking Weekend
Eddie Lau (3dd13@42la.bs)
2. 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
4. Agenda
• Web Application Architecture
• Deploying Rails apps on Heroku.com
• Deploying Rails apps with Dokku
• Other Docker tools
13. Q1: Where to deploy ?
• a machine at your home / office ?
• a machine in Data Center ?
19. 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
Files
Application
Log
Server
Monitoring
Performance
Monitoring
21. 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
…
29. 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
Files
Application
Log
Server
Monitoring
Performance
Monitoring
31. 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
Files
Application
Log
Server
Monitoring
Performance
Monitoring
33. 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
Files
Application
Log
Server
Monitoring
Performance
Monitoring
34. Web App Components
Web Application
(Ruby on Rails)
Web Frontend
(AngularJs)
Push Server
(Node.js)
Database
(PostgreSQL)
Search Engine
(Elastic Search)
RDS
Object Cache
Redis To Go
(Redis)
Search Box
Static Asset
s3
Files
Application
Log Entries
Log
Server
Monitoring
Performance
New Relic
Pusher Monitoring
UptimeRobot
38. • 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
45. I want my own server
with total control
but less hassle
49. There are other advantages
than just automation too:
https://www.docker.com/whatisdocker/
50. We still use heroku heavily.
but for some growing projects,
we start using Docker
52. 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
53. Dev Tools
Fig - Isolated development environment
• http://www.fig.sh/rails.html
• https://github.com/docker/fig
55. 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