From 25799b5a2a87bbc32172d7a51b22fe2d6641cdc7 Mon Sep 17 00:00:00 2001 From: Arindam Kulshi Date: Fri, 6 Dec 2024 11:58:01 -0800 Subject: [PATCH 1/6] added default paramaters to dev file --- backend/src/main/resources/application.yaml | 7 +++---- dev-env.yaml | 11 +++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index bf39617d..80a9c714 100644 --- a/backend/src/main/resources/application.yaml +++ b/backend/src/main/resources/application.yaml @@ -1,9 +1,8 @@ spring: datasource: - url: ${POSTGRES_HOST:postgres_fqdn}?sslmode=require - username: ${DB_USERNAME:postgres_user} - password: ${POSTGRES_USER:postgres_password} - name: ${POSTGRES_DB:postgres_db_name} + url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${DB_PORT:5432}/${POSTGRES_DB:reportvision}?sslmode=require + username: ${POSTGRES_USER:postgres} + password: ${POSTGRES_PASSWORD:super_secret_password} devtools: restart: enabled: true diff --git a/dev-env.yaml b/dev-env.yaml index 56da7afe..5bb061a2 100644 --- a/dev-env.yaml +++ b/dev-env.yaml @@ -30,12 +30,11 @@ services: shm_size: 128mb ports: - "5432:5432" - environment: - POSTGRES_DB: ${postgres_db_name} - POSTGRES_HOST: ${postgres_fqdn} - POSTGRES_USER: ${postgres_user} - POSTGRES_PASSWORD: ${postgres_password} - sslmode: require + environment: + POSTGRES_DB: reportvision + POSTGRES_HOST: localhost + POSTGRES_USER: postgres + POSTGRES_PASSWORD: super_secret_password api: build: context: ./backend From 4a9fd8da6c78b325317668a2018f95016a62edd6 Mon Sep 17 00:00:00 2001 From: Arindam Kulshi Date: Fri, 6 Dec 2024 12:19:07 -0800 Subject: [PATCH 2/6] added default values for dev-env file --- backend/src/main/resources/application.yaml | 6 +++--- dev-env.yaml | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index 80a9c714..0beea00d 100644 --- a/backend/src/main/resources/application.yaml +++ b/backend/src/main/resources/application.yaml @@ -1,8 +1,8 @@ spring: datasource: - url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${DB_PORT:5432}/${POSTGRES_DB:reportvision}?sslmode=require - username: ${POSTGRES_USER:postgres} - password: ${POSTGRES_PASSWORD:super_secret_password} + url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${DB_PORT:5432}/${POSTGRES_DB:reportvision}?sslmode=${SSL_MODE:disable} + username: ${POSTGRES_USER:postgres} + password: ${POSTGRES_PASSWORD:super_secret_password} devtools: restart: enabled: true diff --git a/dev-env.yaml b/dev-env.yaml index 5bb061a2..6e53140c 100644 --- a/dev-env.yaml +++ b/dev-env.yaml @@ -31,10 +31,12 @@ services: ports: - "5432:5432" environment: - POSTGRES_DB: reportvision - POSTGRES_HOST: localhost - POSTGRES_USER: postgres - POSTGRES_PASSWORD: super_secret_password + POSTGRES_DB: ${postgres_db_name:reportvision} + POSTGRES_HOST: ${postgres_fqdn:localhost} + POSTGRES_USER: ${postgres_user:postgres} + POSTGRES_PASSWORD: ${postgres_password:super_secret_password} + DB_PORT: ${postgres_port:5432} + SSL_MODE: ${postgres_sslmode:disable} api: build: context: ./backend From c1e301b6aadd07aae318965b7edf6d402d4848a6 Mon Sep 17 00:00:00 2001 From: Arindam Kulshi Date: Fri, 6 Dec 2024 12:20:50 -0800 Subject: [PATCH 3/6] formatting --- dev-env.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/dev-env.yaml b/dev-env.yaml index 6e53140c..14b607ed 100644 --- a/dev-env.yaml +++ b/dev-env.yaml @@ -30,13 +30,13 @@ services: shm_size: 128mb ports: - "5432:5432" - environment: - POSTGRES_DB: ${postgres_db_name:reportvision} - POSTGRES_HOST: ${postgres_fqdn:localhost} - POSTGRES_USER: ${postgres_user:postgres} - POSTGRES_PASSWORD: ${postgres_password:super_secret_password} - DB_PORT: ${postgres_port:5432} - SSL_MODE: ${postgres_sslmode:disable} + environment: + POSTGRES_DB: ${postgres_db_name:reportvision} + POSTGRES_HOST: ${postgres_fqdn:localhost} + POSTGRES_USER: ${postgres_user:postgres} + POSTGRES_PASSWORD: ${postgres_password:super_secret_password} + DB_PORT: ${postgres_port:5432} + SSL_MODE: ${postgres_sslmode:disable} api: build: context: ./backend From f4c8b32caf16c7c00a4a0bcb3b594c5e0f29f314 Mon Sep 17 00:00:00 2001 From: Arindam Kulshi Date: Fri, 6 Dec 2024 13:20:33 -0800 Subject: [PATCH 4/6] added bash exp synthax --- dev-env.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dev-env.yaml b/dev-env.yaml index 14b607ed..4bccd393 100644 --- a/dev-env.yaml +++ b/dev-env.yaml @@ -31,12 +31,12 @@ services: ports: - "5432:5432" environment: - POSTGRES_DB: ${postgres_db_name:reportvision} - POSTGRES_HOST: ${postgres_fqdn:localhost} - POSTGRES_USER: ${postgres_user:postgres} - POSTGRES_PASSWORD: ${postgres_password:super_secret_password} - DB_PORT: ${postgres_port:5432} - SSL_MODE: ${postgres_sslmode:disable} + POSTGRES_DB: ${postgres_db_name:-reportvision} + POSTGRES_HOST: ${postgres_fqdn:-localhost} + POSTGRES_USER: ${postgres_user:-postgres} + POSTGRES_PASSWORD: ${postgres_password:-super_secret_password} + DB_PORT: ${postgres_port:-5432} + SSL_MODE: ${postgres_sslmode:-disable} api: build: context: ./backend From e03daea8b15405cfb4fbffa86be37780e588e96d Mon Sep 17 00:00:00 2001 From: Arindam Kulshi Date: Tue, 10 Dec 2024 14:11:00 -0800 Subject: [PATCH 5/6] edited url for spring db --- backend/src/main/resources/application.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/resources/application.yaml b/backend/src/main/resources/application.yaml index 0beea00d..d1245d58 100644 --- a/backend/src/main/resources/application.yaml +++ b/backend/src/main/resources/application.yaml @@ -1,6 +1,6 @@ spring: datasource: - url: jdbc:postgresql://${POSTGRES_HOST:localhost}:${DB_PORT:5432}/${POSTGRES_DB:reportvision}?sslmode=${SSL_MODE:disable} + url: jdbc:postgresql://${POSTGRES_HOST:db}:${DB_PORT:5432}/${POSTGRES_DB:reportvision}?sslmode=${SSL_MODE:disable} username: ${POSTGRES_USER:postgres} password: ${POSTGRES_PASSWORD:super_secret_password} devtools: From 173a49c27de87824e9ffae5221e200a0c16b1bc5 Mon Sep 17 00:00:00 2001 From: Arindam Kulshi Date: Tue, 10 Dec 2024 14:13:16 -0800 Subject: [PATCH 6/6] added entry point to dev docker file --- backend/dev-dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/dev-dockerfile b/backend/dev-dockerfile index 0fbd123e..451218df 100644 --- a/backend/dev-dockerfile +++ b/backend/dev-dockerfile @@ -2,3 +2,4 @@ FROM amazoncorretto:17 ENV HOME=/app RUN mkdir -p $HOME WORKDIR $HOME +ENTRYPOINT [ "./gradlew", "bootRun", "--continuous", "--args=--server.port=8081" ] \ No newline at end of file