A multicontainer nodejs and react application using docker
and docker-compose
with deployment to AWS.
This repository contains materials from Stephen Grider's Docker and Kubernetes: The Complete Guide course on Udemy.
This lecture note is not intended to be a replacement for the videos, but only to serve as a cheat sheet for students who want to quickly run thru the AWS configuration steps or easily see if they missed a step. Steps listed are accurate as of 7-11-2019, keep in mind that AWS makes frequent small changes to their UI.
-
Go to AWS Management Console and use Find Services to search for RDS
-
Click Create database button
-
Select PostgreSQL
-
Check 'only enable options eligible for RDS Free Usage Tier' and click Next button
-
Scroll down to Settings Form
-
Set DB Instance identifier to multi-docker-postgres
-
Set Master Username to postgres
-
Set Master Password to postgres and confirm
-
Click Next button
-
Make sure VPC is set to Default VPC
-
Scroll down to Database Options
-
Set Database Name to fibvalues
-
Scroll down and click Create Database button
-
Go to AWS Management Console and use Find Services to search for ElastiCache
-
Click Redis in sidebar
-
Click the Create button
-
Make sure Redis is set as Cluster Engine
-
In Redis Settings form, set Name to multi-docker-redis
-
Change Node type to 'cache.t2.micro'
-
Change Number of replicas to 0
-
Scroll down to Advanced Redis Settings
-
Subnet Group should say “Create New"
-
Set Name to redis-group
-
VPC should be set to default VPC
-
Tick all subnet’s boxes
-
Scroll down and click Create button
-
Go to AWS Management Console and use Find Services to search for VPC
-
Click Security Groups in sidebar
-
Click Create Security Group button
-
Set Security group name to multi-docker
-
Set Description to multi-docker
-
Set VPC to default VPC
-
Click Create Button
-
Click Close
-
Manually tick the empty field in the Name column of the new security group and type multi-docker, then click the checkmark icon.
-
Scroll down and click Inbound Rules
-
Click Edit Rules button
-
Click Add Rule
-
Set Port Range to 5432-6379
-
Click in box next to Custom and start typing 'sg' into the box. Select the Security Group you just created, it should look similar to 'sg-…. | multi-docker’
-
Click Save Rules button
-
Click Close
-
Go to AWS Management Console and use Find Services to search for ElastiCache
-
Click Redis in Sidebar
-
Check box next to Redis cluster and click Modify
-
Change VPC Security group to the multi-docker group and click Save
-
Click Modify
-
Go to AWS Management Console and use Find Services to search for RDS
-
Click Databases in Sidebar and check box next to your instance
-
Click Modify button
-
Scroll down to Network and Security change Security group to multi-docker
-
Scroll down and click Continue button
-
Click Modify DB instance button
-
Go to AWS Management Console and use Find Services to search for Elastic Beanstalk
-
Click the multi-docker application tile
-
Click Configuration link in Sidebar
-
Click Modify in Instances card
-
Scroll down to EC2 Security Groups and tick box next to multi-docker
-
Click Apply and Click Confirm
-
Go to AWS Management Console and use Find Services to search for Elastic Beanstalk
-
Click the multi-docker application tile
-
Click Configuration link in Sidebar
-
Select Modify in the Software tile
-
Scroll down to Environment properties
-
In another tab Open up ElastiCache, click Redis and check the box next to your cluster. Find the Primary Endpoint and copy that value but omit the :6379
-
Set REDIS_HOST key to the primary endpoint listed above, remember to omit :6379
-
Set REDIS_PORT to 6379
-
Set PGUSER to postgres
-
Set PGPASSWORD to postgrespassword
-
In another tab, open up RDS dashboard, click databases in sidebar, click your instance and scroll to Connectivity and Security. Copy the endpoint.
-
Set the PGHOST key to the endpoint value listed above.
-
Set PGDATABASE to fibvalues
-
Set PGPORT to 5432
-
Click Apply button
-
Go to AWS Management Console and use Find Services to search for IAM
-
Click Users link in the Sidebar
-
Click Add User button
-
Set User name to multi-docker-deployer
-
Set Access-type to Programmatic Access
-
Click Next:Permissions button
-
Select Attach existing polices directly button
-
Search for 'beanstalk' and check all boxes
-
Click Next:Review
-
Add tag if you want and Click Next:Review
-
Click Create User
-
Copy Access key ID and secret access key for use later
-
Open up Travis dashboard and find your multi-docker app
-
Click More Options, and select Settings
-
Scroll to Environment Variables
-
Add AWS_ACCESS_KEY and set to your AWS access key