Skip to content

Commit

Permalink
Enhance custom-scripts (#671)
Browse files Browse the repository at this point in the history
* feat: add custom scripts support in entrypoint.sh

* fix: update command in comment

* fix: remove comment
  • Loading branch information
f-necas authored Nov 29, 2023
1 parent fd8f5e5 commit 875067e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN unzip mapstore.war -d mapstore
FROM tomcat:9-jdk11-openjdk
MAINTAINER geosolutions<[email protected]>

RUN mkdir -p /docker-entrypoint.d
# Tomcat specific options
ENV CATALINA_BASE "$CATALINA_HOME"
ENV JAVA_OPTS="${JAVA_OPTS} -Xms512m -Xmx512m -XX:MaxPermSize=128m"
Expand Down

This file was deleted.

9 changes: 9 additions & 0 deletions georchestra-docker-scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

DIR=/docker-entrypoint.d

# Executing custom scripts located in CUSTOM_SCRIPTS_DIRECTORY if environment variable is set
if [[ -z "${CUSTOM_SCRIPTS_DIRECTORY}" ]]; then
echo "[INFO] No CUSTOM_SCRIPTS_DIRECTORY env variable set"
else
echo "[INFO] CUSTOM_SCRIPTS_DIRECTORY env variable set to ${CUSTOM_SCRIPTS_DIRECTORY}"
cp -v "${CUSTOM_SCRIPTS_DIRECTORY}"/* "$DIR"
echo "[INFO] End copying custom scripts"
fi

if [[ -d "$DIR" ]]
then
# Regex is needed to execute all kind of files, including sh files. Warning : --regex not available in alpine images.
Expand Down

0 comments on commit 875067e

Please sign in to comment.