Skip to content

Quick Start

frank-yoon edited this page Jul 31, 2019 · 5 revisions

Quick Start

Create a project

Clone this repo

$ git clone https://github.com/frank-yoon/eb-rails-react.git

Change into the directory

$ cd eb-rails-react

Check out the latest release.

$ git checkout release/v1

Start up the Rails web server

$ rails server

Deploy to AWS Elastic Beanstalk

Create credentials

$ rails credentials:edit

On successful execution, the command will create two files:

  • config/credentials.yml.enc
  • config/master.key

Do not commit config/master.key to a public repository; instead, put the master key in a password manager. By default, both Rails and this repository .gitignore config/master.key. An alternative to including a master key via config/master.key is to configure it in the AWS Elastic Beanstalk Ruby environment property RAILS_MASTER_KEY.

Create a source bundle

Create a source bundle containing the files created by Rails. The following command creates a source bundle named rails-default.zip.

$ cd eb-rails-react
$ zip ../rails-default.zip -FSr * .[^.]* -x@.exclude.lst

Create a Ruby environment in AWS Elastic Beanstalk

https://us-east-1.console.aws.amazon.com/elasticbeanstalk/home?region=us-east-1#/newEnvironment?applicationName=Elastic%20Beanstalk%20Ruby%20Sample%20App

Configure the Create a web server environment page as follows:

  • Platform
    • Preconfigured platform: Ruby
  • Base configuration
    • Application code: Upload your code

Click Upload. Configure the Upload your code page as follows:

  • Source code origin
    • Local file: Click Choose File. Choose your previously bundled source code (i.e., rails-default.zip) and then click Upload.

Click Create environment – AWS will begin creating a Ruby environment.