This is the way to build a production environment on AWS by turning a Ruby on Rails application created as a portfolio into a Docker container. The portfolio itself is here. [[Portfolio] Overview of the portfolio created during job change activities (Tec camp)] (https://qiita.com/sho_U/items/058e590325ee6833abb0)
I was suffering a lot, so I hope it helps someone.
title | |
---|---|
1 | Docker containerization of Rails application in local environment |
2 | Create a VPC on AWS. Create a public subnet |
3 | Create a private subnet |
4 | Create an EC2 instance |
5 | Create an RDS |
6 | Upload Docker container to AWS |
Actually, I will explain the reason later, but you need to create two private subnets in different Availability Zones. The Availability Zone is, roughly speaking, the area where the server where the cloud is stored is actually located.
Therefore, make the following configuration.
Enter the VPC dashboard from the AWS console, select a subnet and create a subnet.
Select the VPC you created earlier for your VPC ID.
Availability Zone: This time ap-northease-1a
Name: fitO2_private_subnet_1a
IPv4 CIDR block: 10.0.20.0/24
Click "Create Subnet"
Enter the VPC dashboard from the AWS console, select a subnet and create a subnet.
Select the VPC you created earlier for your VPC ID.
Availability Zone: This time ap-northease-1c
Name: fitO2_private_subnet_1c
IPv4 CIDR block: 10.0.21.0/24
Click "Create Subnet"
Click a security group on your EC2 dashboard, then click Create Security Group.
Click Add Rule.
Security group name: fitO2_db_SG VPC: The VPC you just created Inbound : Type: MYSQL/Aurora Port: 3306 Source : custom Specify the security group (created earlier) that you plan to apply to EC2 instances located in the public subnet. (If you type in the name, it will come out. If it does not come out, copy and paste the group ID)
This completes the creation of the two private subnets and the security groups shown below that you plan to apply to them.
Continue to next time (4) Create an EC2 instance |
Recommended Posts