![]() ![]() Today's video is the next in the series of setting up our produciton app for production use in AWS ECS. We'll be covering how to Dockerize a Rails app, AWS Fargate, logging, monitoring, and CDN support. Server_name domain.tld try_files $uri/index.html $uri /config/database.What's the 2018 approach to deploying a Rails app to AWS? We've partnered with DailyDrip on a series of videos to guide you through the process. Server unix:/home/ubuntu/apps/repo-name/shared/sockets/puma.sock fail_timeout=0 # Path to Puma SOCK file, as defined previously Rails -v # must display 5.2.1 if installed correctlyĪdd the below content to the server block that we just created. Nevertheless, lets use it to avoid surprises. Rbenv rehash # latest version of rbenv apparently don't need this. Which ruby # must show the fully qualified path of the executableĮcho "gem: -no-document" > ~/.gemrc # to skip documentation while installing gem Ruby -v # must display 2.5.1 if installed correctly Type rbenv # to see if rbenv is installed correctlyĮcho 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' > ~/.bashrc We will use rbenv to manage multiple ruby versions on our server.Įcho 'export PATH="$HOME/.rbenv/bin:$PATH"' > ~/.bashrcĮcho 'eval "$(rbenv init -)"' > ~/.bashrc Once the required dependencies are installed, let us move on to install Ruby and Rails. Navigate to that directory and run the following command to modify permissions of the pem file. Locate the pem file that we’ve downloaded to our local machine in the previous steps. Now that we have our EC2 instance spinned up, let’s access it using SSH. Click on Launch Instances and give a couple of mins for the new instance to spin up. ![]() Create a new key pair, give it a name and download the private key file (file.pem) to your local machine. A key pair is a set of public-private keys. Here you will be asked to create a key pair to log in to your instance. In the next step review our selection so far and click on Launch. In the 6th step, add a new rule for HTTP and mark Source as anywhere for both rules. Follow through steps 3,4,5 without any changes. Select Ubuntu Server 16.04 in the 1st step and t2.micro in 2nd step. Clicking on that takes you to a page where you see multiple steps on the top. Look for a big blue button that says Launch instance. ![]() Now use the search bar on the page under AWS services, type EC2 and click on the first result. Click on that and you will see a list of AWS regions. You should see N.Virginia on the top right corner of the page. Let’s grab an account and login to the console. Why not? AWS offers an awesome free tier that gives limited access to most of its service suite. We decided to use AWS for the sake of this tutorial. Understandably, we decided to pull one ourselves. We wanted to show them how swiftly Rails apps can be deployed but surprisingly couldn’t find an authentic tutorial from our quick Google search to walk them through end-to-end. Nevertheless, during a recent interaction with one of our customers, we were talking at length on how the ecosystem evolved around Rails and how more and more people are embracing it as the de-facto framework for their web application development. Ruby on Rails has come a long way since its early days and there are tons of articles/tutorials/guides on the internet explaining how to do something-everything in Rails (ask the tech geeks at Twitter, GitHub or Netflix). We Love Rails and we use it widely at Gleecus to power the digital backbone of some of our customers’ products and solutions. ![]()
0 Comments
Leave a Reply. |