diff --git a/Dockerfile b/Dockerfile index 9546e0371e..59e66f7bf2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,8 @@ FROM nginx:1.21.4-alpine RUN rm -rf /usr/share/nginx/html/* COPY dist/apps/datafeeder /usr/share/nginx/html COPY nginx-default.conf /etc/nginx/conf.d/default.conf +COPY custom-start.sh /custom-start.sh EXPOSE 80 +ENTRYPOINT ["sh", "/custom-start.sh", "sh", "/docker-entrypoint.sh"] CMD ["nginx", "-g", "daemon off;"] diff --git a/custom-start.sh b/custom-start.sh new file mode 100755 index 0000000000..ad633ce472 --- /dev/null +++ b/custom-start.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +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 + # No regex and verbose in this image + /bin/run-parts "$DIR" +fi + +exec "$@"