├── README.md ├── aws_ecs.pdf ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── javatechie │ │ └── aws │ │ └── ecs │ │ └── SpringbootDockerAwsEcsApplication.java └── resources │ └── application.properties └── test └── java └── com └── javatechie └── aws └── ecs └── SpringbootDockerAwsEcsApplicationTests.java /README.md: -------------------------------------------------------------------------------- 1 | # springboot-docker-ecs 2 | Run your Docker image on AWS ECS (Elastic Container Service) 3 | 4 | ### Required commands 5 | 6 | - Build Docker Image. 7 | 8 | mvn spring-boot:build-image 9 | 10 | - Run Docker Image. 11 | 12 | docker run --tty --publish 8080:8080 13 | 14 | - Tag Docker Image 15 | 16 | docker tag tag-name/ 17 | 18 | - Push Docker Image to Docker Hub 19 | 20 | docker push tag-name/ 21 | 22 | - Application Flow 23 | 24 | 11 25 | 26 | -------------------------------------------------------------------------------- /aws_ecs.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Java-Techie-jt/springboot-docker-ecs/0cff0dd4b05d5eab805f4c8b84b2004e3c2e17b5/aws_ecs.pdf -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.3.3.RELEASE 9 | 10 | 11 | com.javatechie 12 | springboot-docker-aws-ecs 13 | 0.0.1-SNAPSHOT 14 | springboot-docker-aws-ecs 15 | Demo project for Spring Boot 16 | 17 | 18 | 1.8 19 | 20 | 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | 28 | org.springframework.boot 29 | spring-boot-starter-test 30 | test 31 | 32 | 33 | org.junit.vintage 34 | junit-vintage-engine 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-maven-plugin 45 | 2.3.0.RELEASE 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/main/java/com/javatechie/aws/ecs/SpringbootDockerAwsEcsApplication.java: -------------------------------------------------------------------------------- 1 | package com.javatechie.aws.ecs; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.PathVariable; 7 | import org.springframework.web.bind.annotation.RequestMapping; 8 | import org.springframework.web.bind.annotation.RestController; 9 | 10 | @SpringBootApplication 11 | @RestController 12 | @RequestMapping("/") 13 | public class SpringbootDockerAwsEcsApplication { 14 | 15 | @GetMapping 16 | public String applicationStatus() { 17 | return "Application is up and running !"; 18 | } 19 | 20 | @GetMapping("/{name}") 21 | public String welcome(@PathVariable String name) { 22 | return "Hi " + name + " Welcome to javatechie AWS ECS Example"; 23 | } 24 | 25 | public static void main(String[] args) { 26 | SpringApplication.run(SpringbootDockerAwsEcsApplication.class, args); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/test/java/com/javatechie/aws/ecs/SpringbootDockerAwsEcsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.javatechie.aws.ecs; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootDockerAwsEcsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | --------------------------------------------------------------------------------