Skip to content

Commit

Permalink
Merge pull request #266 from edevosc2c/georchestra-gn4.2.x-23.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas authored Dec 6, 2023
2 parents 67c0205 + a368a7d commit eec24be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions web/src/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ COPY --chown=jetty:jetty . /
# Temporary switch to root
USER root

RUN mkdir -p /docker-entrypoint.d
RUN chown jetty:jetty /docker-entrypoint.d
RUN mkdir -p /mnt/geonetwork_datadir && \
chown jetty:jetty /mnt/geonetwork_datadir

Expand Down
12 changes: 11 additions & 1 deletion web/src/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@

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
/bin/run-parts --verbose "$DIR"
# Regex is needed to execute all kind of files, including sh files. Warning : --regex not available in alpine images.
/bin/run-parts --verbose "$DIR" --regex='.*'
fi

exec "$@"

0 comments on commit eec24be

Please sign in to comment.