From 8ad679689b8a1668457178fdc0421cd61dac10ff Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 9 Jun 2018 12:25:25 +0200 Subject: [PATCH] post-start script add API download permission fix --- metactl/post-start.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/metactl/post-start.sh b/metactl/post-start.sh index 56f3bb4..e89b517 100644 --- a/metactl/post-start.sh +++ b/metactl/post-start.sh @@ -83,7 +83,7 @@ docker exec php-fpm bash -c "cd /vhost; composer install" >/dev/null 2>&1 && ech # 2. Re-build js/scss echo -n " * Webpack build............."; -docker exec php-fpm bash -c "cd /vhost; npm install; npm run build" >/dev/null 2>&1 && echo "built" || (echo "failed"; exit 1); +docker exec php-fpm bash -c "cd /vhost; npm install; npm update; npm run build" >/dev/null 2>&1 && echo "built" || (echo "failed"; exit 1); # 3. touch the file the backup loop will use to run echo -n " * Mariadb backup loop......."; @@ -103,3 +103,19 @@ backup(){ backup & echo "done" + + + +## [5] Setup/Fix permissions (for API download) + +# 1. Create download directories +echo -n " * Create download folders..."; +docker exec php-fpm bash -c "mkdir -p /vhost/tmp"; +docker exec php-fpm bash -c "mkdir -p /vhost/public_html/tmp"; +echo "created" + +# 2. Fix permissions +echo -n " * Setup permissions........."; +docker exec php-fpm bash -c "chown -R www-data:www-data /vhost"; +docker exec php-fpm bash -c "chmod -R 775 /vhost"; +echo "set" \ No newline at end of file