At BRADIENT we use Solidus eCommerce and AWS to deploy our client's websites. In this tutorial, we’ll show you how to deploy a Solidus eCommerce application to Amazon AWS Elastic Beanstalk, the leading Cloud Computing Services platform.
AWS Elastic Beanstalk is an orchestration service offered from Amazon Web Services for deploying infrastructure which orchestrates various AWS services, including EC2, S3, Simple Notification Service (SNS), CloudWatch, autoscaling, and Elastic Load Balancers.
- Installed and configured Elastic Beanstalk vía the command line interface (EB CLI)
- Rails (version 5.2.0 was used to write this article)
- Ruby, 2.5.1, Rails, 5.2.0, Solidus, v2.6.0
Install and configure your eCommerce locally
First of all, like you did a thousand times, create your new Rails application:
Install the required Solidus gem. Simply add the following lines to your Gemfile:
> vim Gemfile
Note that we are also specifying the aws-sdk gem; this is needed if we want to use S3. Edit your config/database.yml and add the database configuration:
Install and run migrations on Solidus:
Initialize your project and make your first commit in Git:
Run bundle exec rails s then go to http://localhost:3000 and make sure you correctly visualize the homepage.
Configure Elastic Beanstalk
Ok, let’s start running some commands using EB CLI Commands. Then you can initiate a new Environment application with the following:
If you are using a separate AWS account use this instead: > eb init --profile profile_name
select this option: 4) Ruby 2.4 (Puma)
Include your EB Extensions configurations, please make sure that you copy and paste correctly since these are space sensitive.
> vim .ebextensions/01_packages.config
> vim .ebextensions/02_nginx.config
Commit your changes:
Create your .ENV keys:
At the root of your app:
Deploy, create and setenv keys for your app to an EB environment with a single command:
Pass in the profile to the command above if any: --profile profile_name
Next tutorial is on how to setup the TLS/SSL with AWS ACM Certificate.