Dockerize your Java Spring App, Deploy it on AWS

App Runner

Current Architecture

Let’s Docker it up!

FROM tomcat:9.0.64-jre11    (the chosen DockerHub image)
ADD target/provman.war /usr/local/tomcat/webapps/
(The relative location of your WAR file)
EXPOSE 8080 (The port that the Docker container will listen to)
docker build -t provman .      (don’t forget the dot!)
docker run -p 80:8080 provman

Push it Real Good

aws ecr get-login-password --region [REGION] | docker login --username AWS --password-stdin [ACCOUNT ID].dkr.ecr.[REGION]
docker tag [IMAGE ID] [ACCOUNT ID].dkr.ecr.[REGION] push [ACCOUNT ID].dkr.ecr.[REGION]

App Runner Configuration

Add a new VPC Connector to your App Runner service

App Runner vs Fargate

AppRunner is ahead, followed by Fargate, then comes EKS and EC2 islast. Duke is encouraging everyone.
Who will be the fastest service to deploy a containerized Java Spring application?


Interesting links



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Melina Schweizer

Melina Schweizer

Melina Schweizer is a Sr. Specialist Solutions Architect at AWS and an avid do-it-yourselfer.