From 6422da193be26c75f15041d6661ed7063ea358f6 Mon Sep 17 00:00:00 2001 From: Darko Gjorgjijoski Date: Mon, 29 Jul 2024 13:01:43 +0200 Subject: [PATCH] Improve .dev/php/entrypoint permissions setting --- .dev/php/entrypoint.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.dev/php/entrypoint.sh b/.dev/php/entrypoint.sh index 90623f0a..22575bf0 100755 --- a/.dev/php/entrypoint.sh +++ b/.dev/php/entrypoint.sh @@ -6,32 +6,39 @@ echo "############################################" cd /home/invoiceshelf/app -chmod 775 storage/framework -chmod 775 storage/logs -chmod 775 bootstrap/cache - -chown -R ${UID}:${GID} /home/invoiceshelf/app - -chmod +x artisan +# Composer build if [ ! -d vendor ]; then composer install fi +# Empty sqlite database if [ ! -f database/database.sqlite ]; then cp database/stubs/sqlite.empty.db database/database.sqlite fi +# .env file set up if [ ! -f .env ]; then cp .env.example .env php artisan key:generate --force fi +# NPM build if [ ! -d node_modules ]; then npm install npm run build fi +# Storage symlink php artisan storage:link +# Permissions +chmod 775 storage/framework +chmod 775 storage/logs +chmod 775 bootstrap/cache +chown -R ${UID}:${GID} /home/invoiceshelf/app +chmod +x artisan + +echo "Entrypoint complete." + exec $@