Deploying Web Apps with PaaS and Docker Tools

  • Published on
    02-Jul-2015

  • View
    481

  • Download
    6

DESCRIPTION

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

Transcript

  • 1. Deploying Web Appswith PaaSand Docker ToolsDocker Global Hacking WeekendEddie Lau (3dd13@42la.bs)

2. MeFounder of 42 Labs (http://www.42la.bs)Software Consultancy for Tech StartupsOnline Portfoliohttps://www.linkedin.com/in/3dd13http://github.com/3dd13http://3dd13.me 3. instead of telling what Docker is,I will show youwhy / when do we use it 4. Agenda Web Application Architecture Deploying Rails apps on Heroku.com Deploying Rails apps with Dokku Other Docker tools 5. Problem 6. publish my awesome Rails app 7. Solution 8. upload to a server 9. install libraries 10. EASY ? 11. Consideration 12. Q1: Where to deploy ? 13. Q1: Where to deploy ? a machine at your home / office ? a machine in Data Center ? 14. NO !! 15. use Cloud 16. Q2: How to deploy ? 17. we usually haveseveral 3-month-size projectsat the same time 18. a 3-month-size MVP projectcan be like 19. Web App ComponentsWeb Application(Ruby on Rails)Web Frontend(AngularJs)Push Server(Node.js)Database(PostgreSQL)Search Engine(Elastic Search)Object Cache(Redis)Static AssetFilesApplicationLogServerMonitoringPerformanceMonitoring 20. On a Ubuntu server,you may have to 21. sudo apt-get updatesudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libgdbm-dev libncurses5-dev automakelibtool 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 22. If we have to do this12+ times a year 23. NO !! 24. use Automation 25. Q3: Who ?Q4: What ?Q5: When ? 26. if your teamis still setting up server manually 27. Change your company orChange your company 28. Cloudifyto enhanceautomation 29. Web App ComponentsWeb Application(Ruby on Rails)Web Frontend(AngularJs)Push Server(Node.js)Database(PostgreSQL)Search Engine(Elastic Search)Object Cache(Redis)Static AssetFilesApplicationLogServerMonitoringPerformanceMonitoring 30. I dont want to bother withOTHER STUFF 31. Web App ComponentsWeb Application(Ruby on Rails)Web Frontend(AngularJs)Push Server(Node.js)Database(PostgreSQL)Search Engine(Elastic Search)Object Cache(Redis)Static AssetFilesApplicationLogServerMonitoringPerformanceMonitoring 32. there areFreemium Cloud servicesout there 33. Web App ComponentsWeb Application(Ruby on Rails)Web Frontend(AngularJs)Push Server(Node.js)Database(PostgreSQL)Search Engine(Elastic Search)Object Cache(Redis)Static AssetFilesApplicationLogServerMonitoringPerformanceMonitoring 34. Web App ComponentsWeb Application(Ruby on Rails)Web Frontend(AngularJs)Push Server(Node.js)Database(PostgreSQL)Search Engine(Elastic Search)RDSObject CacheRedis To Go(Redis)Search BoxStatic Assets3FilesApplicationLog EntriesLogServerMonitoringPerformanceNew RelicPusher MonitoringUptimeRobot 35. How aboutcoding runtime environmentsetup? 36. PaaS 37. Demo: Heroku 38. Generate new rails apprails new docker-hk-meetup database=postgresqlcd docker-hk-meetuprails generate controller home index initialize gitgit initgit add -Agit commit -m initial commit create a heroku appheroku create docker-hk-meetup publishgit push heroku master available online !heroku open 39. Heroku is awesome 40. BUT 41. you will grow to a point 42. ExpensiveLost controlSlow 43. so How ? 44. OfficeMachineDataCenterCloudServerHeroku ? 45. I want my own serverwith total controlbut less hassle 46. OfficeMachineDataCenterCloudServer? Herokutotal controlbut less hassle ? 47. Docker 48. Demo: Dokku 49. There are other advantagesthan just automation too:https://www.docker.com/whatisdocker/ 50. We still use heroku heavily.but for some growing projects,we start using Docker 51. Docker Tools 52. PaaSDokku - private heroku https://github.com/progrium/dokkuOctohost - private heroku http://octohost.io/Deis - like Dokku for server cluster https://github.com/deis/deisFlynn - like Dokku for server cluster https://github.com/flynn/flynn 53. Dev ToolsFig - Isolated development environment http://www.fig.sh/rails.html https://github.com/docker/fig 54. Docker ManagementInterfacePanamax - Web interface http://panamax.io/ 55. Manage ClusterSerf - cluster membership by gossip notification https://www.serfdom.io/ https://github.com/hashicorp/serfShipyard - Multi-host cluster Docker management http://shipyard-project.com/ https://github.com/shipyard/shipyard 56. Questions ?mailto:3dd13@42la.bshttps://www.linkedin.com/in/3dd13http://github.com/3dd13http://3dd13.me