https://github.com/ashutoshsahoo/spring-data-jpa-practice
Sample project with spring boot, spring data jpa, h2, postgresql, flyway and jib maven plugin
https://github.com/ashutoshsahoo/spring-data-jpa-practice
data-migration flyway flyway-h2 flyway-postgresql flyway-spring h2 h2-database jib jib-maven-plugin jpa postgresql spring-boot spring-data-jpa springboo
Last synced: 7 months ago
JSON representation
Sample project with spring boot, spring data jpa, h2, postgresql, flyway and jib maven plugin
- Host: GitHub
- URL: https://github.com/ashutoshsahoo/spring-data-jpa-practice
- Owner: ashutoshsahoo
- Created: 2020-05-06T13:44:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-09T15:04:03.000Z (over 5 years ago)
- Last Synced: 2025-01-25T17:11:18.658Z (9 months ago)
- Topics: data-migration, flyway, flyway-h2, flyway-postgresql, flyway-spring, h2, h2-database, jib, jib-maven-plugin, jpa, postgresql, spring-boot, spring-data-jpa, springboo
- Language: Java
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
## Spring Boot JPA practice
Sample project to use spring boot with
* spring data jpa
* flyway
* postgresql
* h2
* jib maven plugin### Build the maven project (ensure docker environment is set):
```sh
mvn clean package -DskipTests
```
### Run the docker image :
```sh
docker run -p 8080:8080 ashutoshsahoo/spring-boot-app
```
Check application status:
```shcurl 'localhost:8080/api/v1/books' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json'```
The response should be```json
[{"id":1000,"isbn":"9780596520688","name":"Physics Book name","author":"Ashutosh Sahoo"}]
```
To run with postgresql(update url, username and password ) :
```sh
docker run -p 8080:8080 \
-e spring_datasource_url=jdbc:postgresql://localhost/booksdb \
-e spring_datasource_username=springuser \
-e spring_datasource_password=springuser \
-e spring_flyway_locations=classpath:db/migration/postgresql \
ashutoshsahoo/spring-boot-app```