Skip to content

Commit

Permalink
Add support for additional environment variables
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gcolon021 committed Aug 23, 2024
1 parent ca86356 commit f0ebbcc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:-}

0 comments on commit f0ebbcc

Please sign in to comment.