Develop a Spring Boot and MySQL Application and run in Docker (end-to-end)
Introduction
In this article, we will design a sample Spring Boot application with Spring MVC, MySQL and JPA. We will then create a docker image of the developed application and run the application image as a docker container.
Application Overview
As part of this Spring boot application, we will design a sample transaction management solution which persists all transactions performed in the application in database. It exposes 3 REST endpoints for its users to create, view (specific) and view (all) transactions
Software and Tools
- Java 12
- Spring Tool Suite (STS)
- MySQL
- Docker
- Postman
Creating the Spring Boot Application
Open STS and create a new Spring Starter Project with following maven dependencies:- Spring Web Starter, Spring Data JPA and MySQL Driver