Skip to content

Basic Spring Boot web application using JPA-Hibernate. Also, steps are provided to deploy the same on Docker and Kubernetes.

Notifications You must be signed in to change notification settings

preetampatil3d/spring-hibernate-jpa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

- Spring Boot web application with JPA-Hibernate example
- Same example is deployed on docker with two containers (app & mysql)
-
# ****************** Docker ************************
- Bild jar 
$ mvn clean install -DskipTests

- Create network : 
$ docker network create springdb-network

- Create Mysql container : 
$ docker run --name mysqldb --network springdb-network -e MYSQL_ROOT_PASSWORD=root@123 -e MYSQL_DATABASE=db_example -d mysql:8

- build SpringBoot application container:
$ docker build -f Dockerfile . -t springjpa:1.0.0

- run container:
$ docker run --network springdb-network --name springjpa-container -p 8080:8080 -d springjpa:1.0.0 

# ****************** k8s ************************
kubenetes: (directory : k8s)

1. Create mysql pod. (db.yml)
2. Create mysql service to expose mysql to spring app. (db-service.yml)
3. Create application pod. (app.yml)
4. Create application service to expose outside.
5. Get service URL using below command if using minikube.
	$minikube service springjpa-service --url
	
	
# ******************* GIT **************************
Git Push Commands > Go To Project Directory 
$git init
$git remote add origin https://github.com/preetampatil3d/spring-hibernate-jpa.git
$git add .
$git commit -m "First Commit"
$git push origin main  (use --force option in case of issue)
    
$git pull
  
 #Extra commands
$git reset --hard HEAD~
$git log --all --decorate --oneline --graph	

About

Basic Spring Boot web application using JPA-Hibernate. Also, steps are provided to deploy the same on Docker and Kubernetes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published