The Spring Boot Application uses MySQL as the underlying database and data access has been done using JPA. The REST API end points have been tested locally and are fully functional. Below are the steps to dockerize the application.
- Pull the mysql image from docker hub
- Run the command docker run -d -p 3307:3306 --name mysqldb -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=employees mysql
- There is a docker file present in root directory of project.
- Run this command in root directory docker build -t springbootapp .
- Run the command docker network create app-network
- Finally run the command docker run -p 9090:8080 --name appcontainer --net app-network -e MYSQL_HOST=mysqldb -e MYSQL_USER=root -e MYSQL_PASSWORD=root -e MYSQL_PORT=3306 springbootapp