diff --git a/ckan-pycsw/Dockerfile b/ckan-pycsw/Dockerfile index 92f473a7..3d2c7ebe 100644 --- a/ckan-pycsw/Dockerfile +++ b/ckan-pycsw/Dockerfile @@ -19,6 +19,6 @@ WORKDIR ${APP_DIR} # Update files if needed COPY pycsw/conf/pycsw.conf.template docker-entrypoint.d/entrypoint.sh ./ -USER $USERNAME +USER root ENTRYPOINT ["/bin/bash", "./entrypoint.sh"] \ No newline at end of file diff --git a/ckan-pycsw/docker-entrypoint.d/entrypoint.sh b/ckan-pycsw/docker-entrypoint.d/entrypoint.sh index 9e24c2e2..c7a0e608 100644 --- a/ckan-pycsw/docker-entrypoint.d/entrypoint.sh +++ b/ckan-pycsw/docker-entrypoint.d/entrypoint.sh @@ -2,6 +2,13 @@ set -xeuo pipefail +# Change ownership of log and metadata directories +chown -R $USERNAME:$USERNAME ${APP_DIR}/log +chown -R $USERNAME:$USERNAME ${APP_DIR}/metadata + +# Switch to the non-root user +su - $USERNAME + envsubst < pycsw.conf.template > pycsw.conf #TODO: -Xfrozen_modules=off from: https://bugs.python.org/issue1666807 diff --git a/ckan-pycsw/pycsw/conf/pycsw.conf.template b/ckan-pycsw/pycsw/conf/pycsw.conf.template index 607c3f3d..87826a3e 100644 --- a/ckan-pycsw/pycsw/conf/pycsw.conf.template +++ b/ckan-pycsw/pycsw/conf/pycsw.conf.template @@ -57,7 +57,7 @@ database=sqlite:///${PWD}/cite.db table=records #filter=type='http://purl.org/dc/dcmitype/Dataset' -#[metadata:inspire] +[metadata:inspire] enabled=true languages_supported=eng,spa default_language=eng