Last active
March 29, 2018 15:30
-
-
Save javagrails/7583ac06acf7d477b953537c5f99bc99 to your computer and use it in GitHub Desktop.
Spring PostgreSql by Docker Configuration for Development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------- postgresql.yml ---------------------- | |
version: '2' | |
services: | |
yourProjectName-pg: | |
image: postgres:9.6-alpine | |
volumes: | |
- ~/dockerdata/yourProjectName/postgresql/:/var/lib/postgresql/data/ | |
environment: | |
- POSTGRES_USER=openuser | |
- POSTGRES_PASSWORD=openpass | |
- POSTGRES_DB=opendb | |
ports: | |
- 5010:5432 | |
---------------------- postgresql.yml ---------------------- | |
---------------------- application-dev.yml ---------------------- | |
datasource: | |
type: com.zaxxer.hikari.HikariDataSource | |
url: jdbc:postgresql://localhost:5010/opendb | |
username: openuser | |
password: openpass | |
jpa: | |
database-platform: io.github.jhipster.domain.util.FixedPostgreSQL82Dialect | |
database: POSTGRESQL | |
open-in-view: false | |
show-sql: false | |
hibernate: | |
ddl-auto: update | |
naming: | |
physical-strategy: org.springframework.boot.orm.jpa.hibernate.SpringPhysicalNamingStrategy | |
implicit-strategy: org.springframework.boot.orm.jpa.hibernate.SpringImplicitNamingStrategy | |
properties: | |
hibernate.id.new_generator_mappings: true | |
hibernate.cache.use_second_level_cache: true | |
hibernate.cache.use_query_cache: false | |
hibernate.generate_statistics: false | |
hibernate.cache.region.factory_class: io.github.jhipster.config.jcache.NoDefaultJCacheRegionFactory | |
---------------------- application-dev.yml ---------------------- | |
---------------------- postgresql.yml running command ---------------------- | |
1. Open terminal | |
2. cd to/your/projectRootFolder | |
3. Runcommand [ docker-compose -f src/main/docker/postgresql.yml up ] | |
4. Now run your project it works great in shah Allah | |
---------------------- postgresql.yml running command ---------------------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment