From d829afaa77689b93b0d4d891ded2bc5556dae35d Mon Sep 17 00:00:00 2001 From: cde-barros Date: Thu, 5 Sep 2024 10:43:09 +0200 Subject: [PATCH] test parametrage datahub --- tools/docker/Dockerfile | 4 ++-- tools/docker/docker-entrypoint-ign.sh | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index feae75fbb0..8aba92a450 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -22,9 +22,9 @@ ENV CUSTOM_SCRIPTS_DIRECTORY "" COPY dist/apps/${APP_NAME} /opt/catalogue/ RUN chmod +x /opt/docker-entrypoint-ign.sh -RUN chown -R www-data:www-data /opt/catalogue/assets/configuration +# RUN chown -R www-data:www-data /opt/catalogue/assets/configuration -USER www-data +# USER www-data EXPOSE 8080 diff --git a/tools/docker/docker-entrypoint-ign.sh b/tools/docker/docker-entrypoint-ign.sh index 346363396f..b9421df087 100755 --- a/tools/docker/docker-entrypoint-ign.sh +++ b/tools/docker/docker-entrypoint-ign.sh @@ -8,11 +8,20 @@ CONFIG_FILE_NAME=default.toml if [ ! -z "${GN4_API_URL}" ] then echo "[INFO] Replacing GN4 url in conf with: ${GN4_API_URL}..." - sed "s%geonetwork4_api_url = \".*\"%geonetwork4_api_url = \"${GN4_API_URL}\"%" ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} > /tmp/${CONFIG_FILE_NAME} && cat /tmp/${CONFIG_FILE_NAME} > ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} - rm /tmp/${CONFIG_FILE_NAME} + chmod 775 ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} + sed "s%geonetwork4_api_url = \".*\"%geonetwork4_api_url = \"${GN4_API_URL}\"%" ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} > /tmp/${CONFIG_FILE_NAME} + # && cat /tmp/${CONFIG_FILE_NAME} > ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} + # rm /tmp/${CONFIG_FILE_NAME} + rm -f ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} + cp /tmp/${CONFIG_FILE_NAME} ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} + chmod 444 ${APP_FILES_PATH}${CONFIG_FILE_PATH}${CONFIG_FILE_NAME} + rm -f /tmp/${CONFIG_FILE_NAME} fi echo "[INFO] docker-entrypoint-ign.sh ended successfully." +# run as www-data +su www-data + # Start Apache in foreground /usr/sbin/apachectl -D FOREGROUND