run setup as www-data

pull/1/head
chris 2020-07-05 16:18:18 +02:00
parent 3a98a29cfa
commit 312b44ab00
1 changed files with 10 additions and 11 deletions

View File

@ -13,25 +13,24 @@ php /wait-for-db.php
if [[ ! -e storage/.docker.init ]] if [[ ! -e storage/.docker.init ]]
then then
echo "Fresh installation, initializing database..." echo "Fresh installation, initializing database..."
php artisan key:generate gosu www-data php artisan key:generate
php artisan migrate:fresh --force gosu www-data php artisan migrate:fresh --force
php artisan passport:install gosu www-data php artisan passport:keys
chown www-data:www-data storage/oauth*key
echo done > storage/.docker.init echo done > storage/.docker.init
fi fi
php artisan storage:link gosu www-data php artisan storage:link
php artisan horizon:publish gosu www-data php artisan horizon:publish
php artisan route:cache gosu www-data php artisan route:cache
php artisan view:cache gosu www-data php artisan view:cache
php artisan config:cache gosu www-data php artisan config:cache
echo "++++ Check for needed migrations... ++++" echo "++++ Check for needed migrations... ++++"
# check for 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" ]; if [ $migrations = "yes" ];
then then
php artisan migrate --force gosu www-data php artisan migrate --force
fi fi
echo "++++ Start apache... ++++" echo "++++ Start apache... ++++"