From 312b44ab00ad33ae984dd8d221d8af444df4db53 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 5 Jul 2020 16:18:18 +0200 Subject: [PATCH] run setup as www-data --- entrypoint.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index c9d4e85..034d505 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -13,25 +13,24 @@ php /wait-for-db.php if [[ ! -e storage/.docker.init ]] then echo "Fresh installation, initializing database..." - php artisan key:generate - php artisan migrate:fresh --force - php artisan passport:install - chown www-data:www-data storage/oauth*key + gosu www-data php artisan key:generate + gosu www-data php artisan migrate:fresh --force + gosu www-data php artisan passport:keys echo done > storage/.docker.init fi -php artisan storage:link -php artisan horizon:publish -php artisan route:cache -php artisan view:cache -php artisan config:cache +gosu www-data php artisan storage:link +gosu www-data php artisan horizon:publish +gosu www-data php artisan route:cache +gosu www-data php artisan view:cache +gosu www-data php artisan config:cache echo "++++ Check for needed migrations... ++++" # check for migrations -php artisan migrate:status | grep No && migrations=yes || migrations=no +gosu www-data php artisan migrate:status | grep No && migrations=yes || migrations=no if [ $migrations = "yes" ]; then - php artisan migrate --force + gosu www-data php artisan migrate --force fi echo "++++ Start apache... ++++"