Skip to content
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
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ RUN [ -n "${DEBUG}" ] && set -x; \
mkdir -pv \
"${LABKEY_FILES_ROOT}/@files" \
"config" \
"externalModules" \
"logs" \
"startup" \
"${TOMCAT_BASE_DIR}" \
Expand Down Expand Up @@ -259,8 +258,6 @@ HEALTHCHECK \
"https://localhost:${LABKEY_PORT}${HEALTHCHECK_ENDPOINT}" \
|| exit 1

VOLUME "${LABKEY_FILES_ROOT}/@files"
VOLUME "${LABKEY_HOME}/externalModules"
VOLUME "${LABKEY_HOME}/logs"

EXPOSE ${LABKEY_PORT}
Expand Down
2 changes: 2 additions & 0 deletions application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ context.resources.jdbc.labkeyDataSource.maxWaitMillis=${POSTGRES_MAX_WAIT_MILLIS
context.resources.jdbc.labkeyDataSource.accessToUnderlyingConnectionAllowed=${POSTGRES_ACCESS_UNDERLYING_CONNECTIONS}
context.resources.jdbc.labkeyDataSource.validationQuery=${POSTGRES_VALIDATION_QUERY}

context.externalModules=${LABKEY_EXTERNAL_MODULES}

# send access logs to file:
# server.tomcat.accesslog.directory=/tmp
# server.tomcat.accesslog.enabled=true
Expand Down
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ services:
volumes:
- ./mounts/files:/labkey/files
# - files:/labkey/files
- ./mounts/modules:/labkey/externalModules
- ./mounts/logs:/labkey/logs
environment:
# - DEBUG=1
Expand Down Expand Up @@ -132,7 +131,6 @@ services:
volumes:
- ./mounts/files:/labkey/files
# - files:/labkey/files
- ./mounts/modules:/labkey/externalModules
- ./mounts/logs:/labkey/logs
environment:
# - DEBUG=1
Expand Down Expand Up @@ -244,7 +242,6 @@ services:
volumes:
- ./mounts/files:/labkey/files
# - files:/labkey/files
- ./mounts/modules:/labkey/externalModules
- ./mounts/logs:/labkey/logs
environment:
# - DEBUG=1
Expand Down Expand Up @@ -357,7 +354,6 @@ services:
volumes:
- ./mounts/files:/labkey/files
# - files:/labkey/files
- ./mounts/modules:/labkey/externalModules
- ./mounts/logs:/labkey/logs
environment:
# - DEBUG=1
Expand Down Expand Up @@ -427,6 +423,8 @@ services:
- DD_COLLECT_APM=${DD_COLLECT_APM-false}
- SLEEP=${SLEEP:-0}
- PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS=${PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS:-90}
- PURGE_MTNC_LOGS_OLDER_THAN_DAYS=${PURGE_MTNC_LOGS_OLDER_THAN_DAYS:-90}
- LABKEY_EXTERNAL_MODULES=${LABKEY_EXTERNAL_MODULES:-/labkey/files/externalModules}

pg-lims_starter:
image: postgres:15
Expand Down
32 changes: 21 additions & 11 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ JSON_OUTPUT="${JSON_OUTPUT:-false}"
DD_COLLECT_APM="${DD_COLLECT_APM:-false}"
JAVA_RMI_SERVER_HOSTNAME="${JAVA_RMI_SERVER_HOSTNAME:-}"

# set age past which old heap and error log directories are removed
# set age past which old heap and error log directories and system maintenance files are removed
PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS="${PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS:-90}"
PURGE_MTNC_LOGS_OLDER_THAN_DAYS="${PURGE_MTNC_LOGS_OLDER_THAN_DAYS:-90}"

# set path to external modules)
LABKEY_EXTERNAL_MODULES="${LABKEY_EXTERNAL_MODULES:-/labkey/files/externalModules}"

SLEEP="${SLEEP:=0}"

Expand Down Expand Up @@ -147,9 +151,6 @@ main() {
awsclibin/aws s3 cp $LABKEY_OPTIONAL_APP_PROPERTIES_S3_URI config/
fi

echo "sleeping for $SLEEP seconds..."
sleep $SLEEP

# echo "deleting awscli and unsetting AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, & AWS_SESSION_TOKEN, if set..."
# rm -rf awsclibin aws-cli
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN
Expand Down Expand Up @@ -258,20 +259,30 @@ main() {
-Djava.rmi.server.hostname=${JAVA_RMI_SERVER_HOSTNAME}"
fi

echo "Purging secrets and other bits from environment variables..."
unset POSTGRES_USER POSTGRES_PASSWORD POSTGRES_HOST POSTGRES_PORT POSTGRES_DB POSTGRES_PARAMETERS
unset SMTP_HOST SMTP_USER SMTP_PORT SMTP_PASSWORD SMTP_AUTH SMTP_FROM SMTP_STARTTLS
unset LABKEY_CREATE_INITIAL_USER LABKEY_CREATE_INITIAL_USER_APIKEY LABKEY_INITIAL_USER_APIKEY LABKEY_INITIAL_USER_EMAIL LABKEY_INITIAL_USER_GROUP LABKEY_INITIAL_USER_ROLE
unset LABKEY_EK SLEEP CONTAINER_PRIVATE_IP

echo "Creating new heap/error log directory..."
HEAP_AND_ERROR_PATH="$LABKEY_HOME/files/heap_dumps_and_errors_$(date +%Y%m%d_%H%M%S)"
mkdir -pv $HEAP_AND_ERROR_PATH

echo "Creating externalModules directory if it does not already exist..."
mkdir -pv $LABKEY_EXTERNAL_MODULES

# purge old heap/error directories
echo "Purging heap/error log directories older than $PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS days..."
find "$LABKEY_HOME/files/" -mindepth 1 -maxdepth 1 -type d -ctime +${PURGE_HEAP_AND_ERROR_LOGS_OLDER_THAN_DAYS} -name "heap*" | xargs rm -rf

# purge old system maintenance files
echo "Purging system maintenance files older than $PURGE_MTNC_LOGS_OLDER_THAN_DAYS days..."
find "$LABKEY_HOME/files/@files" -mindepth 1 -maxdepth 1 -type d -ctime +${PURGE_MTNC_LOGS_OLDER_THAN_DAYS} -name "system_maintenance*" | xargs rm -rf

echo "sleeping for $SLEEP seconds..."
sleep $SLEEP

echo "Purging secrets and other bits from environment variables..."
unset POSTGRES_USER POSTGRES_PASSWORD POSTGRES_HOST POSTGRES_PORT POSTGRES_DB POSTGRES_PARAMETERS
unset SMTP_HOST SMTP_USER SMTP_PORT SMTP_PASSWORD SMTP_AUTH SMTP_FROM SMTP_STARTTLS
unset LABKEY_CREATE_INITIAL_USER LABKEY_CREATE_INITIAL_USER_APIKEY LABKEY_INITIAL_USER_APIKEY LABKEY_INITIAL_USER_EMAIL LABKEY_INITIAL_USER_GROUP LABKEY_INITIAL_USER_ROLE
unset LABKEY_EK SLEEP CONTAINER_PRIVATE_IP

# shellcheck disable=SC2086
exec java \
\
Expand All @@ -290,7 +301,6 @@ main() {
\
-Dlabkey.home="$LABKEY_HOME" \
-Dlabkey.log.home="${LABKEY_HOME}/logs" \
-Dlabkey.externalModulesDir="${LABKEY_HOME}/externalModules" \
\
-Djava.library.path=/usr/lib:/usr/lib/x86_64-linux-gnu \
\
Expand Down
Empty file removed mounts/modules/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion quickstart_envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# example minimal set of environment variables to get started - see readme for additional envs you may wish to set

# embedded tomcat LabKey .jar version to build container with
export LABKEY_VERSION="25.7"
export LABKEY_VERSION="25.8"

# minimal SMTP settings
export SMTP_HOST="localhost"
Expand Down