fix: restore Docker env settings and auto-seed on container start

This commit is contained in:
GuavaPopper
2026-06-02 19:51:21 +07:00
parent 5683cd3b0e
commit 3310efe77e
3 changed files with 100 additions and 5 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env sh
set -e
cd /var/www/html
if [ ! -f .env ] && [ -f .env.docker.example ]; then
cp .env.docker.example .env
fi
if [ ! -f vendor/autoload.php ]; then
composer install
fi
php artisan config:clear --no-ansi
if ! grep -q '^APP_KEY=base64:' .env 2>/dev/null; then
php artisan key:generate --force --no-ansi
fi
php artisan migrate --force --no-ansi
php artisan db:seed --force --no-ansi
exec "$@"