Apexit#02 Deploy Rails App with Puma and Nginx on EC2 Ubuntu 14.04LTS instance
We have already developed our application and now we want to move it to
production. Here, I am mentioning checklist for moving our app to production. There are plenty of resources are available so we will not go in depth and recreating stuff that is already created. These are just checklist. I have also mentioned good reference for each point. I will be reachable through email if you have any questions. You can also drop your message by clicking green chat icon bottom-right most corner.
Steps:
- Create one EC2 Ubuntu 14.04 instance: ref: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EC2_GetStarted.html
- Install RVM or rbenv: ref: https://rvm.io/rvm/install
- Install ruby 2.3.1:
rvm install 2.3.1
- Install GIT:
sudo apt-get install git
- Install Bundler:
gem install bundler
- Install Rails: https://gorails.com/setup/ubuntu/14.04
- Install NodeJS: ref: above link
- Clone your repo
- RAILS_ENV=production bundle install
- Create one RDS instance of Postgres(optional) ref: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_GettingStarted.CreatingConnecting.PostgreSQL.html
- Update Database.yml and build your production Database
- Update security groups on EC2
- Setup Puma: ref: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04
- Setup Nginx: ref: above link
- Test
Apexit is technical articles series in which I will took one real world problem, will develop code for it together and share the source code with other people.
About Author
Mayur is a Chief Technical Architect in his organisation. He has more than three years of experience in designing and building scale able applications using different technologies.