make sure we generate app key

This commit is contained in:
hackerESQ
2024-09-04 18:37:41 -05:00
parent 82c5c23278
commit 11e95e7b5f
2 changed files with 9 additions and 3 deletions
+7 -1
View File
@@ -2,12 +2,18 @@
echo "Running entrypoint script..."
if [ ! -f /var/www/app/.env ]; then
if [ ! -f "/var/www/app/.env" ]; then
echo "Ope, gotta create an .env file!"
cp /var/www/app/.env.example /var/www/app/.env
fi
if ( ! grep -q "^APP_KEY=" "/var/www/app/.env" || grep -q "^APP_KEY=$" "/var/www/app/.env"); then
echo "Ah, APP_KEY is missing in .env file. Generating a new key!"
/usr/local/bin/php /var/www/app/artisan key:generate
fi
echo "Installing Composer dependencies..."
/usr/local/bin/composer install