Skip to content

Commit

Permalink
feat: add custom scripts support in entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 26, 2023
1 parent 4e8afb5 commit 4207a9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions Dockerfile-ogc-api-records
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ EXPOSE 8080
ENV JAVA_OPTS=-Dfile.encoding=UTF-8

COPY docker/ /
RUN mkdir -p /docker-entrypoint.d
ENTRYPOINT [ "/docker-entrypoint.sh" ]

ADD ./modules/services/ogc-api-records/target/gn-ogc-api-records.jar /opt/app/gn-ogc-api-records.jar
Expand Down
11 changes: 0 additions & 11 deletions docker/docker-entrypoint.d/100-execute-custom-scripts.sh

This file was deleted.

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

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}"
# Regex is needed in jetty9 images, but not alpine's ones.
cp -v "${CUSTOM_SCRIPTS_DIRECTORY}"/* "$DIR"
echo "[INFO] End moving 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 4207a9e

Please sign in to comment.