From 54e24e2e0f5fecdd60ded43e00997ca5ada3e50b Mon Sep 17 00:00:00 2001 From: Julien Nahum Date: Wed, 28 Aug 2024 15:38:55 +0200 Subject: [PATCH] Fix the missing directory on docker init --- docker/php-fpm-entrypoint | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docker/php-fpm-entrypoint b/docker/php-fpm-entrypoint index 81f77e33..cd75c59f 100644 --- a/docker/php-fpm-entrypoint +++ b/docker/php-fpm-entrypoint @@ -40,18 +40,19 @@ run_server() { } prep_storage() { - [ -L storage ] || { + mkdir -p /etc/initial-storage + if [ ! -d /etc/initial-storage/app ]; then echo "Backing up initial storage directory" - rm -rf /etc/initial-storage - mv ./storage /etc/initial-storage - } + cp -a ./storage/* /etc/initial-storage/ + fi - [ -d /persist/storage ] || { + mkdir -p /persist/storage + if [ ! -d /persist/storage/app ]; then echo "Initialising blank storage dir" - mkdir -p /persist - cp -a /etc/initial-storage /persist/storage - chmod 777 -R /persist/storage - } + cp -a /etc/initial-storage/* /persist/storage/ + fi + + chmod -R 777 /persist/storage touch /var/log/opnform.log chown www-data /var/log/opnform.log