AWS Docker Deployment - PujithaKoneru/PhotoSite1 GitHub Wiki

Intro and Purpose

Project is running Successfully

Project Description

In this project, I have installed Docker software on ec2, then deployed Project R1(Photosite) into this Docker container and created image for the project and the image is uploaded to the docker hub. I have created EC2 instance on Amazon with the latest version of Ubuntu. Then installed Ruby on Rails onto this instance. Then, I have deployed my rails project PhotoSite on it. Run it by the command - $ sudo docker run -d -p 3000:3000 hh5829/image_name:latest.

Youtube Url

I made two Videos:

https://youtu.be/SYYohpVZ7e8

https://youtu.be/uctB-Ms0-DU

Discuss how your group discovered how to create a Docker Container and show how it was made

Firstly, we tried to install docker. Then we found this website link - https://geekylane.com/install-docker-on-aws-ec2-ubuntu-18-04-script-method/ - to install docker on amazon ec2.

Demonstration - Screenshots

Launching AWS Instances:

Navigate to EC2 in AWS console:

Click on Launch instance in EC2:

Select Ubuntu server 18.04 LTS:

Select General Purpose Free tier eligible:

Configure security group and add a port:

Review and Launch:

Download the private Key File:

CLick on View instances to see all the instances:

Screenshot for ssh connection for AWS EC2:

Screenshot for docker login:

Screenshot for displaying docker images:

Screenshot for pushing docker images to Docker Hub:

Screenshot of Docker Hub with pushed image:

Screenshot for running PhotoSite application with Docker run:

Running the PhotoSite application with public DNS IPV4:

Answer the question: "what happens when an instance stops running?"

When an instance stops running, all the data is lost. In order not to lose our data, we can create an AMI in Amazon S3 i.e re-instance or duplicate our data. It is like we are keeping a copy of our data in S3. So, when an instance stops running, we will still have a copy of our data.

Answer the question: "what happens when you reboot an instance and what can you do?"

When we reboot an instance, we lose our previously existing IP address and get a new IP address. In order to avoid this, we use Elastic IPs. Elastic IPs in AWS allow you to allocate an IP address. Using Elastic IPs, we can reboot an instance, still we won't lose our IP address.