add postgresql connection to the project and move from application.properties to application.yml
This commit is contained in:
parent
d3c22fe3a9
commit
6025a12253
5 changed files with 31 additions and 1 deletions
|
@ -3,6 +3,7 @@ services:
|
||||||
container_name: postgres
|
container_name: postgres
|
||||||
image: postgres
|
image: postgres
|
||||||
environment:
|
environment:
|
||||||
|
POSTGRES_DB: docusphere
|
||||||
POSTGRES_USER: ${DB_USER}
|
POSTGRES_USER: ${DB_USER}
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
PGDATA: /data/postgres
|
PGDATA: /data/postgres
|
||||||
|
|
7
server/README.MD
Normal file
7
server/README.MD
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# Some additional things to consider:
|
||||||
|
|
||||||
|
## .env not being read by application.yml
|
||||||
|
There is currently not a way that environment variables are read from the .env file which the docker-compose.yml file uses.
|
||||||
|
|
||||||
|
You have to manually set the environment variables in e.g. your IDE
|
||||||
|
|
|
@ -19,6 +19,7 @@ repositories {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||||
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
runtimeOnly 'org.postgresql:postgresql'
|
runtimeOnly 'org.postgresql:postgresql'
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
spring.application.name=DocuSphere
|
|
22
server/src/main/resources/application.yml
Normal file
22
server/src/main/resources/application.yml
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: DocuSphere
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
driver-class-name: org.postgresql.Driver
|
||||||
|
url: jdbc:postgresql://localhost:5432/docusphere
|
||||||
|
username: ${DB_USER}
|
||||||
|
password: ${DB_PASSWORD}
|
||||||
|
|
||||||
|
jpa:
|
||||||
|
hibernate:
|
||||||
|
ddl-auto: update
|
||||||
|
show-sql: true
|
||||||
|
properties:
|
||||||
|
hibernate:
|
||||||
|
format_sql: true
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.hibernate.SQL: debug
|
||||||
|
org.hibernate.type.descriptor.sql.BasicBinder: trace
|
Loading…
Reference in a new issue