diff --git a/web/src/docker/Dockerfile b/web/src/docker/Dockerfile index e5d405a93c..4c4c5392de 100644 --- a/web/src/docker/Dockerfile +++ b/web/src/docker/Dockerfile @@ -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 diff --git a/web/src/docker/docker-entrypoint.sh b/web/src/docker/docker-entrypoint.sh index 4c54157358..34ff73817e 100755 --- a/web/src/docker/docker-entrypoint.sh +++ b/web/src/docker/docker-entrypoint.sh @@ -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 "$@"