- Create local volume for PostgreSQL data
mkdir postgres-data
- Use Postgres Docker image, Create Container storage with DB storage, User storage, and Password storage
docker run -d --name storage -e POSTGRES_USER=storage -e POSTGRES_PASSWORD=storage -e PGDATA=/var/lib/postgresql/data/pgdata -e POSTGRES_DB=storage -p5432:5432 -v $PWD/postgres-data:/var/lib/postgresql/data postgres
- Create Spring Boot Minimal JPA with PostgreSQL https://start.spring.io/#!type=maven-project&language=java&platformVersion=2.6.5&packaging=jar&jvmVersion=11&groupId=dev.wcs.minijpa&artifactId=local-storage&name=local-storage&description=Sample%20Project%20for%20a%20Minimal%20JPA%20with%20local%20Persistence%20using%20PostgreSQL&packageName=dev.wcs.minijpa.local-storage&dependencies=postgresql,data-jpa
spring.datasource.url=jdbc:postgresql://localhost:5432/storage
spring.datasource.username=storage
spring.datasource.password=storage
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.hibernate.ddl-auto=update
see also https://github.com/ice09/persistent-storage-minijpa