From 66ce375601ed71d0af1389a9602bae1b3689b668 Mon Sep 17 00:00:00 2001 From: Sietse Snel Date: Mon, 6 Jan 2025 21:38:37 +0100 Subject: [PATCH] Docker setup: fix CKAN storage dir permissions --- docker/images/ckan/Dockerfile | 3 ++- docker/images/ckan/ckan-entrypoint.sh | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/images/ckan/Dockerfile b/docker/images/ckan/Dockerfile index e758350..2f3dcc4 100644 --- a/docker/images/ckan/Dockerfile +++ b/docker/images/ckan/Dockerfile @@ -62,7 +62,8 @@ ENV CKAN_MSL_CORE_VERSION=development ENV CKAN_MSL_UTIL_VERSION=development # Create storage path -RUN mkdir -p $CKAN_STORAGE_PATH/webassets $CKAN_STORAGE_PATH/storage +RUN mkdir -p $CKAN_STORAGE_PATH/webassets $CKAN_STORAGE_PATH/storage && \ + chown -R www-data:www-data $CKAN_STORAGE_PATH # Build-time variables specified by docker-compose.yml / .env ARG CKAN_SITE_URL diff --git a/docker/images/ckan/ckan-entrypoint.sh b/docker/images/ckan/ckan-entrypoint.sh index b54c7db..b5e8514 100644 --- a/docker/images/ckan/ckan-entrypoint.sh +++ b/docker/images/ckan/ckan-entrypoint.sh @@ -58,6 +58,7 @@ else echo "Initializing configuration ..." /usr/lib/ckan/default/bin/ckan -c "$CKAN_CONFIG_FILE" sysadmin add mslapi sudo chown ckan /ckan_api_key /usr/lib/ckan/default/bin/ckan -c "$CKAN_CONFIG_FILE" user token add mslapi mslapi | tail -1 | sed 's/^\t//' > /ckan_api_key/api.key + chown -R www-data:www-data "$CKAN_STORAGE_PATH" touch "$CKAN_INIT_STATUS_FILE" echo "Configuration and database initialization finished." fi