diff --git a/deployment/database/Dockerfile b/deployment/database/Dockerfile index 95cbd94..1f4ccf6 100644 --- a/deployment/database/Dockerfile +++ b/deployment/database/Dockerfile @@ -1,8 +1,4 @@ FROM postgres:14.1-alpine -ENV POSTGRES_DB=db \ - POSTGRES_USER=usr \ - POSTGRES_PASSWORD=pwd - # From "Init database" part COPY setup-db /docker-entrypoint-initdb.d/ \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 749b305..27b3e95 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -8,9 +8,9 @@ spring: generate-ddl: false open-in-view: true datasource: - url: jdbc:postgresql://tp1-backend-db:5432/db - username: usr - password: pwd + url: jdbc:postgresql://${POSTGRES_HOST}/${POSTGRES_DB} + username: ${POSTGRES_USER} + password: ${POSTGRES_PASSWORD} driver-class-name: org.postgresql.Driver management: server: diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index f0690c5..27b3e95 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -6,8 +6,16 @@ spring: lob: non_contextual_creation: true generate-ddl: false + open-in-view: true datasource: - driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver - url: jdbc:tc:postgresql://hostname/simple-api - username: ${embedded.postgresql.user} - password: ${embedded.postgresql.password} \ No newline at end of file + url: jdbc:postgresql://${POSTGRES_HOST}/${POSTGRES_DB} + username: ${POSTGRES_USER} + password: ${POSTGRES_PASSWORD} + driver-class-name: org.postgresql.Driver +management: + server: + add-application-context-header: false + endpoints: + web: + exposure: + include: health,info,env,metrics,beans,configprops