mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-19 03:04:05 +00:00
Add cache clearing and auto-migrate to Docker entrypoint
Clears config and application cache on every container start to prevent stale provider references after image updates. Creates the storage symlink and runs pending migrations if the app is already installed. Fixes #614
This commit is contained in:
@@ -45,3 +45,15 @@ if ! grep -q '^APP_KEY=[^[:space:]]' /var/www/html/.env; then
|
||||
echo "**** Generating new APP_KEY variable ****"
|
||||
./artisan key:generate -n
|
||||
fi
|
||||
|
||||
echo "**** Clearing cached config ****"
|
||||
./artisan config:clear 2>/dev/null || true
|
||||
./artisan cache:clear 2>/dev/null || true
|
||||
|
||||
echo "**** Creating storage link ****"
|
||||
./artisan storage:link --force 2>/dev/null || true
|
||||
|
||||
echo "**** Running migrations (if app is installed) ****"
|
||||
if ./artisan migrate:status > /dev/null 2>&1; then
|
||||
./artisan migrate --force
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user