Docker-Runit/laravel/laravel.runit

27 lines
856 B
Text
Raw Normal View History

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-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."
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
sleep infinity
done