From 7dcd0fc8ab940a0dca12e3ccd72d4ae83961de46 Mon Sep 17 00:00:00 2001 From: Jeffery Antoniuk Date: Wed, 29 May 2024 14:03:53 -0600 Subject: [PATCH] Fix file location and permissions --- .env.sample | 2 +- Dockerfile | 4 +++- docker-compose.yml | 13 ++++++++----- rootfs/etc/s6-overlay/scripts/bagger-setup.sh | 7 +++++++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.env.sample b/.env.sample index fadaf48..137b27c 100644 --- a/.env.sample +++ b/.env.sample @@ -61,7 +61,7 @@ ISLE_REPOSITORY=islandora # # This should match image.isle.tag value in the Helm chart. # PHP 8.1 remote registry -ISLE_TAG=2.0.0 +ISLE_TAG=3.2.4 # PHP 8.1 local registry (i.e., isle-buildkit images built locally) # ISLE_TAG=latest diff --git a/Dockerfile b/Dockerfile index bb88f5b..090f053 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,9 @@ RUN --mount=type=cache,id=bagger-composer-${TARGETARCH},sharing=locked,target=/r --strip \ --dest "/var/www/bagger" \ && \ - composer install -d /var/www/bagger + chown -R nginx:nginx /var/www/bagger \ + && \ + su -s /bin/bash nginx -c "composer install -d /var/www/bagger" \ # `--no-dev` leads to install error - ToDo revise composer.json # APP_ENV=prod composer install -d /var/www/bagger --no-dev # composer install -d /var/www/bagger --no-dev diff --git a/docker-compose.yml b/docker-compose.yml index 52ee0f7..f9e16b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,6 +13,7 @@ secrets: volumes: bagger-data: {} + bagger-aip: {} # Common to all services x-common: &common @@ -41,6 +42,7 @@ services: BAGGER_CROND_ENABLE_SERVICE: ${BAGGER_CROND_ENABLE_SERVICE:-"true"} BAGGER_CROND_SCHEDULE: ${BAGGER_CROND_SCHEDULE:-1 2 * * *} BAGGER_CROND_LOG_LEVEL: ${BAGGER_CROND_LOG_LEVEL:-"8"} + BAGGER_OUTPUT_DIR: ${BAGGER_OUTPUT_DIR:-"/data/aip/"} BAGGER_BAG_DOWNLOAD_PREFIX: ${BAGGER_BAG_DOWNLOAD_PREFIX:-""} # unused BAGGER_DEFAULT_PER_BAG_NAME_TEMPLATE: ${BAGGER_DEFAULT_PER_BAG_NAME_TEMPLATE:-"aip_%"} BAGGER_DEFAULT_PER_BAG_CONTACT_NAME: ${BAGGER_DEFAULT_PER_BAG_CONTACT_NAME:-Contact Name} @@ -51,12 +53,13 @@ services: BAGGER_DEFAULT_PER_BAG_LOG_BAG_CREATION: ${BAGGER_DEFAULT_PER_BAG_LOG_BAG_CREATION:-"true"} BAGGER_DEFAULT_PER_BAG_LOG_BAG_LOCATION: ${BAGGER_DEFAULT_PER_BAG_LOG_BAG_LOCATION:-"false"} BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA: ${BAGGER_DEFAULT_PER_BAG_REGISTER_BAGS_WITH_ISLANDORA:-"false"} - image: ${REPOSITORY}/bagger:${TAG} + image: ${REPOSITORY}/cwrc/isle-bagger:${TAG} ports: - 9856:8000 - secrets: - - source: UID - - source: GID - - source: BAGGER_DRUPAL_DEFAULT_ACCOUNT_PASSWORD + # secrets: + # - source: UID + # - source: GID + # - source: BAGGER_DRUPAL_DEFAULT_ACCOUNT_PASSWORD volumes: - bagger-data:/var/www/bagger/var + - bagger-aip:${BAGGER_OUTPUT_DIR:-/data/aip} diff --git a/rootfs/etc/s6-overlay/scripts/bagger-setup.sh b/rootfs/etc/s6-overlay/scripts/bagger-setup.sh index 0dbe0fe..c152462 100755 --- a/rootfs/etc/s6-overlay/scripts/bagger-setup.sh +++ b/rootfs/etc/s6-overlay/scripts/bagger-setup.sh @@ -11,8 +11,15 @@ EOF fi } +function setup_dir { + mkdir -p ${BAGGER_OUTPUT_DIR} + chown nginx:nginx ${BAGGER_OUTPUT_DIR} + chmod 02755 ${BAGGER_OUTPUT_DIR} +} + function main { setup_cron + setup_dir } main