Railsconf 2014 - Deploying Rails is Easier Thank It Looks
- 2. @talkingquickly
About Me
• Rails Developer, author of “Reliably Deploying Rails Applications”
• Teach people to make stuff with Ruby at MakeItWithCode.com
• Make cool swim technology stuff with SwimIO helloswimio.com
(swim watches, the speedo app etc)
- 7. @talkingquickly
The Web Server
• Nginx/ Apache
• First point of contact when a request comes in
• If it’s for a static file (like a picture) then deals with it directly
• If it’s for part of our Rails app, sends it to the app server
- 8. @talkingquickly
The App Server
• When you run “rails server”, this is what you’re starting
• E.g. Webrick, Thin, Unicorn
• This is the “rails app”
• The web server passes requests to this and it returns responses to
the web server
- 15. @talkingquickly
How To Do it: Configuration Management
• Automates the commands you would type in to setup a server
• Once you’ve done it once, doing it again is trivial
- 19. @talkingquickly
How To Do It: Deployment Automation
• Automates the commands needed to copy a new version of your
code to the server
• You can still deploy with just one command e.g. “cap production
deploy”
- 21. @talkingquickly
What about when it breaks?
• If something breaks, it should self heal as much as possible, if it
can’t it should alert you
• Use “Monitoring” tools e.g. Monit
• Your configuration management is responsible for setting all this up