Skip to content

Commit

Permalink
add default props env var; rm awcli zip after install (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-willm authored Jul 14, 2023
1 parent aa67f35 commit 71f2b44
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ COPY log4j2.xml log4j2.xml
RUN mkdir -p /usr/src/awsclizip \
&& wget -q -O /usr/src/awsclizip/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" \
&& unzip -q -d /usr/src/awsclizip/ /usr/src/awsclizip/awscliv2.zip \
&& rm /usr/src/awsclizip/awscliv2.zip \
&& /usr/src/awsclizip/aws/install
&& /usr/src/awsclizip/aws/install \
&& rm -rf /usr/src/awsclizip

# refrain from using shell significant characters in HEALTHCHECK_HEADER_*
ENV HEALTHCHECK_INTERVAL="6s" \
Expand Down
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ services:
- LABKEY_CREATE_INITIAL_USER_APIKEY=${LABKEY_CREATE_INITIAL_USER_APIKEY-1}

- LABKEY_CUSTOM_PROPERTIES_S3_URI=${LABKEY_CUSTOM_PROPERTIES_S3_URI}
- LABKEY_DEFAULT_PROPERTIES_S3_URI=${LABKEY_DEFAULT_PROPERTIES_S3_URI}
- SLEEP=${SLEEP:-0}

pg-community:
Expand Down Expand Up @@ -175,6 +176,7 @@ services:
- LABKEY_CREATE_INITIAL_USER_APIKEY=${LABKEY_CREATE_INITIAL_USER_APIKEY-1}

- LABKEY_CUSTOM_PROPERTIES_S3_URI=${LABKEY_CUSTOM_PROPERTIES_S3_URI}
- LABKEY_DEFAULT_PROPERTIES_S3_URI=${LABKEY_DEFAULT_PROPERTIES_S3_URI}
- SLEEP=${SLEEP:-0}

pg-allpg:
Expand Down Expand Up @@ -274,6 +276,7 @@ services:
- LABKEY_CREATE_INITIAL_USER_APIKEY=${LABKEY_CREATE_INITIAL_USER_APIKEY-1}

- LABKEY_CUSTOM_PROPERTIES_S3_URI=${LABKEY_CUSTOM_PROPERTIES_S3_URI}
- LABKEY_DEFAULT_PROPERTIES_S3_URI=${LABKEY_DEFAULT_PROPERTIES_S3_URI}
- SLEEP=${SLEEP:-0}

pg-enterprise:
Expand Down Expand Up @@ -373,6 +376,7 @@ services:
- LABKEY_CREATE_INITIAL_USER_APIKEY=${LABKEY_CREATE_INITIAL_USER_APIKEY-1}

- LABKEY_CUSTOM_PROPERTIES_S3_URI=${LABKEY_CUSTOM_PROPERTIES_S3_URI}
- LABKEY_DEFAULT_PROPERTIES_S3_URI=${LABKEY_DEFAULT_PROPERTIES_S3_URI}
- SLEEP=${SLEEP:-0}

pg-lims_starter:
Expand Down
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ keystore_alias="${TOMCAT_KEYSTORE_ALIAS:-}"
keystore_format="${TOMCAT_KEYSTORE_FORMAT:-}"

LABKEY_CUSTOM_PROPERTIES_S3_URI="${LABKEY_CUSTOM_PROPERTIES_S3_URI:=none}"
LABKEY_DEFAULT_PROPERTIES_S3_URI="${LABKEY_DEFAULT_PROPERTIES_S3_URI:=none}"
SLEEP="${SLEEP:=0}"

main() {
Expand Down Expand Up @@ -115,10 +116,15 @@ main() {
export LABKEY_STARTUP_BASIC_EXTRA
fi

# optional s3 uri to a file with custom startup properties, formatted like startup/basic.properties
# optional s3 uris to files with default or custom startup properties, formatted like startup/basic.properties
if [ $LABKEY_DEFAULT_PROPERTIES_S3_URI != 'none' ]; then
echo "trying to s3 cp '$LABKEY_DEFAULT_PROPERTIES_S3_URI'"
aws s3 cp $LABKEY_DEFAULT_PROPERTIES_S3_URI server/startup/
fi

if [ $LABKEY_CUSTOM_PROPERTIES_S3_URI != 'none' ]; then
echo "trying to s3 cp '$LABKEY_CUSTOM_PROPERTIES_S3_URI'"
aws s3 cp $LABKEY_CUSTOM_PROPERTIES_S3_URI server/startup/48_custom.properties
aws s3 cp $LABKEY_CUSTOM_PROPERTIES_S3_URI server/startup/
fi

echo "sleeping for $SLEEP seconds..."
Expand Down
4 changes: 3 additions & 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="22.3.4"
export LABKEY_VERSION="23.7"

# minimal SMTP settings
export SMTP_HOST="localhost"
Expand All @@ -16,3 +16,5 @@ export SMTP_FROM="root@localhost"
export LABKEY_CREATE_INITIAL_USER=""
export LABKEY_CREATE_INITIAL_USER_APIKEY=""

export LABKEY_DEFAULT_PROPERTIES_S3_URI=""
export LABKEY_CUSTOM_PROPERTIES_S3_URI=""

0 comments on commit 71f2b44

Please sign in to comment.