This example demonstrates a spring data JPA-based Spring Boot setup which is backed up by Docker Database images. The images will contain initial data to ease up local development or to easily initiate any staging environment.
The core dependencies of the example are as follows:
- Spring Boot 2.5.0
- Spring 5.3.7
- Hibernate 5.4.31.Final
- PostgreSQL driver 42.2.20
- MySQL connector 8.0.25 (Alternative Database Option)
We are going to follow the listed steps throughout this example:
- Introduce PostgreSQL database as the default database to the application
- Create and run a PostgreSQL docker image backed by initial data
- Add entities and repositories to the application
- Test the initial setup
- Introduce MySQL database as a secondary database option to the application
- Create and run a MySQL docker image backed by initial data