Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added default db params to dev file (fix) #467

Merged
merged 7 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/dev-dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ FROM amazoncorretto:17
ENV HOME=/app
RUN mkdir -p $HOME
WORKDIR $HOME
ENTRYPOINT [ "./gradlew", "bootRun", "--continuous", "--args=--server.port=8081" ]
7 changes: 3 additions & 4 deletions backend/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -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:db}:${DB_PORT:5432}/${POSTGRES_DB:reportvision}?sslmode=${SSL_MODE:disable}
username: ${POSTGRES_USER:postgres}
password: ${POSTGRES_PASSWORD:super_secret_password}
devtools:
restart:
enabled: true
Expand Down
11 changes: 6 additions & 5 deletions dev-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ services:
ports:
- "5432:5432"
environment:
POSTGRES_DB: ${postgres_db_name}
POSTGRES_HOST: ${postgres_fqdn}
POSTGRES_USER: ${postgres_user}
POSTGRES_PASSWORD: ${postgres_password}
sslmode: require
POSTGRES_DB: ${postgres_db_name:-reportvision}
Copy link
Collaborator

@marycrawford marycrawford Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it matter if the dev-env.yaml is using :-name and the application.yaml file is not? For example, POSTGRES_DB: ${postgres_db_name:-reportvision} in the dev-env.yaml and name: ${POSTGRES_DB:postgres_db_name} in the name: ${POSTGRES_DB:postgres_db_name}.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems one is springboot synthax and the other is bash synthax. app.yaml is being used locally so it should work as is.

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
Expand Down
Loading