Dockerized Spring Boot application with Dockerized postgreSQL server (JPA, Hibernate, PostgreSQL)
These instructions will get you a copy of the project up and running on your local machine for development purposes. See running for notes on how to run the project on a system.
-
Clone the project to your local environment:
git clone https://github.com/ankitrajput0096/Dockerized_SpringBoot_PostgreSQL
-
You need maven installed on your environment:
brew install maven
sudo apt-get install maven
-
You need Docker to be installed:
https://download.docker.com/win/stable/Docker%20for%20Windows%20Installer.exe
Once you have maven and docker installed on your environment, install the project dependencies via:
mvn install
Build docker Image:
docker-compose build
Start docker:
docker-compose up
Start docker:
docker-compose up
Run the application from the Application.java
main method directly,
or from a command line:
mvn spring-boot:run
Keep docker running in a separate terminal tab, create another tab to run the application.
Your server should be now running on http://localhost:8090
- Clone this repository
- Bring up the application by just using docker-compose
Your server should be now running on http://localhost:8090
sudo docker-compose -f my-docker-compose.yml up
- Bring down the application
sudo docker-compose -f my-docker-compose.yml down
- Install Postman (https://www.getpostman.com)
- Import Postman collection from the
Dockerized_SpringBoot_PostgreSQL.postman_collection.json
file - Enjoy !!
- Spring Boot - Spring Boot 2
- Maven - Dependency Management
- Docker - For containerization of application
- PostgreSQL - Database
If you have any improvement suggestions please create a pull request and I'll review it.
- Ankit Rajput - Initial work - Github
This project is licensed under the MIT License
- Big thanks to Pivotal for Spring Boot framework, love it!