pixelfed/entrypoint.sh

35 lines
799 B
Bash
Raw Normal View History

2020-05-28 16:18:10 +00:00
#!/usr/bin/env bash
2020-05-29 11:28:45 +00:00
set -xeo pipefail
2020-05-28 16:18:10 +00:00
cp -r storage.skel/* storage/
2020-05-30 10:46:57 +00:00
php /wait-for-db.php
2020-06-08 17:11:53 +00:00
if [[ ! -e storage/.docker.init ]]
2020-05-29 11:12:33 +00:00
then
echo "Fresh installation, initializing database..."
2020-05-29 14:01:37 +00:00
php artisan key:generate
2020-05-29 11:12:33 +00:00
php artisan migrate:fresh --force
php artisan passport:install
chown www-data:www-data storage/oauth*key
echo done > storage/.docker.init
fi
2020-05-28 16:18:10 +00:00
php artisan storage:link
php artisan horizon:assets
php artisan route:cache
php artisan view:cache
php artisan config:cache
2020-06-08 17:11:53 +00:00
echo "++++ Check for needed migrations... ++++"
# check for migrations
php artisan migrate:status | grep No && migrations=yes || migrations=no
if [ $migrations = "yes" ];
then
php artisan migrate --force
fi
echo "++++ Start apache... ++++"
2020-05-28 16:18:10 +00:00
source /etc/apache2/envvars
/usr/local/sbin/dumb-init apache2 -DFOREGROUND