Develop a Spring Boot and MySQL Application and run in Docker (end-to-end)

Somnath Musib
Code Fountain
Published in
6 min readJun 8, 2019

--

Image result for Docker and Spring boot image
Spring Boot With Docker

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

  1. Java 12
  2. Spring Tool Suite (STS)
  3. MySQL
  4. Docker
  5. 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

Create Spring Boot Project

--

--

Somnath Musib
Code Fountain

Educator | Software Developer, Cloud Architect | Author "Spring Boot In Practice" | Find more at https://musibs.github.io