In this series of articles, we will create a rails application from scratch (you can also apply the same steps for an existing rails application)
Before I begin this series, I would like to give credit to Raphael Jambalos who wrote this amazing series of articles in More than “Hello World” in Docker: Build Rails + Sidekiq web apps in Docker. I have done a lot of learning from his work and have added few things of my own.
Now the due credit is done, let’s start.
There will be following articles in this series:
- Create and Dockerize rails application with MYSQL and Sidekiq (Docker + Docker Compose)
- Prepare AWS Security groups for Rails Project
- Create Bastian instance to test or troubleshoot Rails, RDS and Redis
- Create RDS (MYSQL) database for Rails Project
- Create AWS Elastic Cache (redis) for Sidekiq
- Create Load Balancer for Rails Project
- Create IAM user and roles for Rails Project
- Push Rails Docker application to AWS ECR
- Create ECS task definition for Rails Docker image (Rails and Sidekiq)
- Create ECS Cluster and deploy Rails + Sidekiq tasks
- Create CodeDeploy for Rails and Sidekiq Task Definition
- Create Codepipeline for Rails Project
Before we Begin
Let me explain the bigger picture before we begin, Our first step is to setup a Rails + MYSQL + Sidekiq project on our local machine using Docker + Docker Compose.
Once our development environment is setup, we will then prepare AWS for our Docker based Rails website and Sideqkiq.
On AWS we will use AWS ECS (Amazon Elastic Container Service) which is perfect for our Rails Docker project. From ECS we will use the following services:
- ECR (Amazon Elastic Container Registry) contains our Rails Project Docker image.
- ECS Task Definition works as a container for our Rails and Sidekiq Docker images.
- Amazon ECS Clusters our ECS Tasks will be deployed in ECS Clusters Services
Other than ECS, we will RDS and ElasticCache for MYSQL and Redis (for Sidekiq) respectively.
We will also use Load Balancers and Auto Scaling groups to scale up/down your website as per traffic demands.
Finally we will use AWS CodeBuild, CodePipeline for CI/CD process.
This series is for people who wants to deploy high traffic Rails website on AWS with CI/CD enabled.
Fasten your seat belts, Lets start !!!