2023-03-01 17:32:51 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
rm -f /var/lock/laravel_ready
|
|
|
|
echo "[LARAVEL-FIXER] Fixing laravel application permissions"
|
|
|
|
mkdir -p /app/storage /app/bootstrap/cache
|
2021-11-12 16:43:41 +00:00
|
|
|
find /app/storage -type d -exec chmod 777 {} \;
|
|
|
|
find /app/bootstrap/cache -type d -exec chmod 777 {} \;
|
|
|
|
find /app/storage -type f -not -name ".gitignore" -exec chmod 666 {} \;
|
|
|
|
find /app/bootstrap/cache -type f -exec chmod 666 {} \;
|
|
|
|
|
2023-03-01 17:32:51 +00:00
|
|
|
touch /app/storage/logs/laravel.log
|
2021-11-12 16:43:41 +00:00
|
|
|
chmod 777 -R /app/storage
|
|
|
|
chmod +x /app/artisan
|
|
|
|
|
2023-05-18 12:03:02 +00:00
|
|
|
php /app/artisan package:discover
|
2024-02-07 15:21:14 +00:00
|
|
|
if [[ ${REGENERATE_KEYS,,} == "on" ]]; then
|
|
|
|
php /app/artisan key:generate
|
|
|
|
php /app/artisan passport:keys --force
|
2023-03-02 15:33:51 +00:00
|
|
|
fi
|
|
|
|
|
2023-03-01 17:32:51 +00:00
|
|
|
echo "[LARAVEL-FIXER] Waiting for mysql..."
|
|
|
|
/usr/bin/wait-for-mysql
|
|
|
|
echo "[LARAVEL-FIXER] Mysql Ready, Laravel Ready."
|
|
|
|
|
2023-05-18 12:03:02 +00:00
|
|
|
php /app/artisan wipe
|
2023-05-14 22:06:08 +00:00
|
|
|
|
2023-03-01 17:32:51 +00:00
|
|
|
touch /var/lock/laravel_ready
|
|
|
|
|
2021-11-12 16:43:41 +00:00
|
|
|
# Output the laravel log to the docker terminal.
|
2023-03-01 17:32:51 +00:00
|
|
|
tail -n0 -f /app/storage/logs/laravel-*.log /app/storage/logs/laravel.log &
|
2021-11-12 16:43:41 +00:00
|
|
|
|
|
|
|
# Sleep forever (and sleep again incase the sleep process is killed)
|
|
|
|
while true; do
|
2024-02-07 15:21:14 +00:00
|
|
|
sleep infinity
|
2021-11-12 16:43:41 +00:00
|
|
|
done
|