An open API service indexing awesome lists of open source software.

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

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:
```sh

curl '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

```