Please explain how many way we can deploy ruby on rails application in production and what is the best way ?
Easiest way:
- Have your code on Github.
- Signup for Heroku and create an “app” there.
- On the app dashboard, go to “Deploy” and set it to auto deploy your github project.
- On the app dashboard, go to “Resources” and add Heroku PostgreSQL and Heroku Redis addons
- Go back to “Deploy” and hit the button to deploy the app. Wait until it is done
- Go back to “Resources” and add “Web” and “Worker” dynos.
- Click “Open app”
- Done
Hi, you can also use Dokku or Digital Ocean APPS (new feature in BETA), Hatchbox.io , cloud66 also almost all shared webhostings with plesk control panel supports rails.
Also on youtube you can find many videos how to deploy a ubuntu or ebian server yourself for example suando capsitrano dokker.
Deploy Ruby on Rails To Production in 2019: Deploy Ruby on Rails To Production in 2019 - YouTube
Hope you don’t have a problem with it. Let me know if you need help with something.
I’m a big fan of Hatchbox.io I have written about it here
I use it in a bunch of production servers. It has been great.
The choice of the Ruby on Rails application deployment method can be divided into two categories - your own server managed by you (e.g. hosted on Digital Ocean or AWS EC2) and code upload tool (e.g. Capistrano or similar) or a more automated cloud solution, like Heroku or AWS Elastic Beanstalk. I highly recommend the latter 2, because it saves an incredible amount of time, and they are not expensive at the beginning. Both Heroku and Elastic Beanstalk (EB) are based on Git. Deployment is as simple as git push [heroku] [master]
or eb deploy
. EB will use the git archive method and upload the archive to the servers instead of the push command while Heroku relies on your project’s repository clone.
PS. hatchbox, cloud66, dokku and digitalocean apps (nanobox) look like good alternatives to the solutions described above, but I haven’t tested them yet. They fall into category of fully automated solutions similar to AWS EB and Heroku.
As my analysis, i would like to know that, is nginx with passanger or nginx with puma also a way to deploy ruby on rails app on production?
Thanks
All of those are combinations of a reverse proxy (the Web server that interacts with the end-user’s browser) and an application server (the code that interacts with Rack to host your Rails application). They have nothing to do with deploy per se, and everything to do with the actual hosting of the application, as in its interaction with clients.
Walter
Coming back to this, I’ve open sourced the Ansible project that we use to handle our devops and deployment. It also includes various guides explaining the architecture, the workflow, etc.
If you need something simple to get started, then go for Heroku.
If you have a large application that may have significant infrastructure costs, then I recommend using Kubernetes, because Heroku is really expensive at scale (we use DigitalOcean):
Also note that if you have DevOp knowledge also Capistrano on simple DigitalOcean droplets is a good and reliable solution (quite simple to setup, harder to scale if you need to change the infrastructure often).
if that can help, I deploy my rails app on AWS Elastic Beanstalk.
I prebuild my docker images, so they are fast to deploy and ready on autoscaling. I came up with a little script that makes it easy.
hopefully this helps
I recently used Heroku and I must say it is easy to deploy as explained above.
But if you need something similar to Heroku, Render is a good choose, they have a free plan that you can use to see how things work.
You can deploy by having a github account, connected to render.
1 - Start a new project by chosen PostgreSQL if you will need a database.
1.1 - Give a name for your instance
1.2 - Give a name for your database
1.3 - Give a name for your user
1.4 - Chosen the region of your instance
1.5 - Chosen the version of your instance
1.6 - Chosen free plan and it’s.
2 - Start a new project by chosen Web Service.
2.1 - Chosen the deploy method (GitHub).
2.2 - Connect with your github, and chosen the project
2.3 - Give a name
2.4 - Chosen the region
2.5 - Chosen the branch
2.6 - Chosen the runtime type (Ruby)
2.7 - Config the Build Command
2.8 - Config the Start Command
2.9 - Choose free plan
2.10 - Config the web concurrency
2.11 - Config the rails master key
2.12 - Config the database, with the internal databse url
2.13 - Create and enjoy