Skip to content

Commit

Permalink
Refactor Dockerfile and update dependencies
Browse files Browse the repository at this point in the history
Set default Spring profile in Dockerfile. Add AWS Secrets Manager JDBC dependency in pom.xml and create application-bdc.properties for database configuration.
  • Loading branch information
Gcolon021 committed Aug 22, 2024
1 parent 1671d1f commit 980f7f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ COPY --from=build target/dictionary-*.jar /dictionary.jar
# Time zone
ENV TZ="US/Eastern"

ENTRYPOINT java $DEBUG_VARS $PROXY_VARS -Xmx8192m -jar /dictionary.jar
# Default to no profile
ENTRYPOINT java $DEBUG_VARS $PROXY_VARS -Xmx8192m -jar /dictionary.jar --spring.profiles.active=${SPRING_PROFILE:-}
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.amazonaws.secretsmanager</groupId>
<artifactId>aws-secretsmanager-jdbc</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>

<build>
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/application-bdc.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
spring.application.name=dictionary
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.datasource.driver-class-name=com.amazonaws.secretsmanager.sql.AWSSecretsManagerPostgreSQLDriver
spring.datasource.url=jdbc-secretsmanager:mysql://${DATASOURCE_URL}/auth?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&autoReconnectForPools=true
spring.datasource.username=${DATASOURCE_USERNAME}
server.port=80

0 comments on commit 980f7f4

Please sign in to comment.