From f0ebbccbeaaf3ce32d7d6f4398aa255ed3127437 Mon Sep 17 00:00:00 2001 From: GeorgeC Date: Fri, 23 Aug 2024 14:05:32 -0400 Subject: [PATCH] Add support for additional environment variables Introduced new ARG directives in Dockerfile to handle DATASOURCE_URL, DATASOURCE_USERNAME, and SPRING_PROFILE. This addition ensures these variables can be passed at build time, improving flexibility in configuration. --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c49e8d1..457f53e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,9 +16,14 @@ COPY --from=build target/dictionary-*.jar /dictionary.jar # Time zone ENV TZ="US/Eastern" +ARG DATASOURCE_URL +ARG DATASOURCE_USERNAME +ARG SPRING_PROFILE + # If a --env-file is passed in, you can override these values ENV DATASOURCE_URL=${DATASOURCE_URL} ENV DATASOURCE_USERNAME=${DATASOURCE_USERNAME} +ENV SPRING_PROFILE=${SPRING_PROFILE} # Default to no profile -ENTRYPOINT java $DEBUG_VARS $PROXY_VARS -Xmx8192m -jar /dictionary.jar --spring.profiles.active=${SPRING_PROFILE:-} +ENTRYPOINT java $DEBUG_VARS $PROXY_VARS -Xmx8192m -jar /dictionary.jar --spring.profiles.active=${SPRING_PROFILE:-} \ No newline at end of file