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

Create a VPC

Create a VPC first as described here


Create an instance and associate an elastic IP address here


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


Setting Up Auto scaling

Please refer here to setup an AWS autoscaling