Skip to content

Commit

Permalink
Allow for custom logging configuration
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Aug 4, 2023
1 parent 58a8397 commit 059f21a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
docs/
scripts/
src/
!src/main/docker/logback*.xml
target/
!target/*.jar
/*.md
10 changes: 8 additions & 2 deletions src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ ENV TZ=Etc/UTC \
HOME=${DATA_DIR} \
# Default notification publisher templates override environment variables
DEFAULT_TEMPLATES_OVERRIDE_ENABLED=false \
DEFAULT_TEMPLATES_OVERRIDE_BASE_DIRECTORY=${DATA_DIR}
DEFAULT_TEMPLATES_OVERRIDE_BASE_DIRECTORY=${DATA_DIR} \
LOGGING_CONFIG_PATH="logback.xml"

# Create the directories where the WAR will be deployed to (${APP_DIR}) and Dependency-Track will store its data (${DATA_DIR})
# Create a user and assign home directory to a ${DATA_DIR}
Expand Down Expand Up @@ -61,7 +62,12 @@ USER ${UID}
WORKDIR ${APP_DIR}

# Launch Dependency-Track
CMD exec java ${JAVA_OPTIONS} ${EXTRA_JAVA_OPTIONS} --add-opens java.base/java.util.concurrent=ALL-UNNAMED -DdependencyTrack.logging.level=${LOGGING_LEVEL} -jar ${WAR_FILENAME} -context ${CONTEXT}
CMD exec java ${JAVA_OPTIONS} ${EXTRA_JAVA_OPTIONS} \
--add-opens java.base/java.util.concurrent=ALL-UNNAMED \
-Dlogback.configurationFile=${LOGGING_CONFIG_PATH} \
-DdependencyTrack.logging.level=${LOGGING_LEVEL} \
-jar ${WAR_FILENAME} \
-context ${CONTEXT}

# Specify which port Dependency-Track listens on
EXPOSE 8080
Expand Down

0 comments on commit 059f21a

Please sign in to comment.