| | |

Deploying a Docker (Java Spring Boot) application to AWS

Overview

Here we will deploy a Java Spring Boot Docker application into AWS infrastructure

Create a VPC

Create a VPC first as described here

EC2

Create an instance and associate an elastic IP address here

Docker

Install Docker for Amazon Linux 2

sudo amazon-linux-extras install docker

Start the docker

sudo service docker start

Add the ec2-user to the docker group so you can execute Docker commands without using sudo.

Logout and login for the permissions to be applied and verify

docker info

Spring Boot Application Docker Image

[ec2-user@ip-10-0-0-64 ~]$ docker pull logicalsapien/joan

Start the container with Spring Boot App

docker run -d -p 8080:8080 logicalsapien/joan

Testing the App using the public IP

http://3.221.227.151:8080/jobsearch/averagesalary?country=gb&jobName=HGV%20Class%201%20Drivers

http://ec2-3-221-227-151.compute-1.amazonaws.com:8080/jobsearch/averagesalary?country=gb&jobName=HGV%20Class%201%20Drivers

Setting Up Auto scaling

Please refer here to setup an AWS autoscaling

Similar Posts

  • |

    Aws Core Services

    Overview To identify some of the most commonly used services by developers Elastic Cloud Compute (EC2) Amazon EC2 is a web service that provides secure, resizable compute capacity in the cloud. https://aws.amazon.com/ec2/ Simple Storage Service (S3) Amazon S3 is an object storage service that offers scalability, data availability, security, and performance. https://aws.amazon.com/s3/ Relational Database Service…

  • |

    Leveraging the BFF Pattern

    Improve your UI development with the Backend-for-Frontend pattern. Introduction he Backend-for-Frontend (BFF) pattern has become increasingly popular in modern web development, offering numerous benefits to developers and improving user experiences. This article will guide you through implementing the BFF pattern in a UI project with TypeScript, complete with sample code . Understanding the BFF Pattern…

  • | | |

    Docker Commands

    Overview Commonly user docker commands for quick access Basic Docker version docker version Docker Info docker info Containers Docker Run docker run {image-name} Common parameters: -d : Detached mode–name : Name -it : Interactive mode Start a simple web-server: You can see the result @ http://localhost:8080/ Start to terminal / bash in interactive mode Ctr…

Leave a Reply

Your email address will not be published. Required fields are marked *