simplify docker install

also adds auto update into entry point
This commit is contained in:
hackerESQ
2024-09-05 21:34:09 -05:00
parent 8511cc833d
commit 36c2707a51
2 changed files with 10 additions and 6 deletions
+10 -5
View File
@@ -1,19 +1,24 @@
#!/bin/bash
cd /var/www/app
echo "====================== Running entrypoint script... ====================== "
if [ ! -f "/var/www/app/.env" ]; then
if [ ! -f ".env" ]; then
echo " > Ope, gotta create an .env file!"
cp /var/www/app/.env.example /var/www/app/.env
cp .env.example .env
fi
if ( ! grep -q "^APP_KEY=" "/var/www/app/.env" || grep -q "^APP_KEY=$" "/var/www/app/.env"); then
if ( ! grep -q "^APP_KEY=" ".env" || grep -q "^APP_KEY=$" ".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
/usr/local/bin/php artisan key:generate
fi
echo "====================== Checking for updates... ====================== "
/usr/bin/git pull
echo "====================== Installing Composer dependencies... ====================== "
/usr/local/bin/composer install
@@ -22,7 +27,7 @@ echo "====================== Install NPM dependencies and build frontend... ===
/usr/bin/npm run build
echo "====================== Running migrations... ====================== "
/usr/local/bin/php /var/www/app/artisan migrate --force
/usr/local/bin/php artisan migrate --force
echo "====================== Spinning up Supervisor daemon... ====================== "
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf