Files
investbrain/docker/entrypoint.sh
T

34 lines
1.1 KiB
Bash
Raw Normal View History

2024-09-04 17:48:40 -05:00
#!/bin/bash
2024-09-05 21:34:09 -05:00
cd /var/www/app
2024-09-05 18:32:29 -05:00
echo "====================== Running entrypoint script... ====================== "
2024-09-05 21:34:09 -05:00
if [ ! -f ".env" ]; then
2024-09-04 18:41:04 -05:00
echo " > Ope, gotta create an .env file!"
2024-09-04 17:48:40 -05:00
2024-09-05 21:34:09 -05:00
cp .env.example .env
2024-09-04 17:48:40 -05:00
fi
2024-09-05 21:34:09 -05:00
echo "====================== Checking for updates... ====================== "
/usr/bin/git pull
2024-09-05 18:32:29 -05:00
echo "====================== Installing Composer dependencies... ====================== "
/usr/local/bin/composer install
2024-09-05 21:49:06 -05:00
echo "====================== Validating environment... ====================== "
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 artisan key:generate --force
fi
echo "====================== Installing NPM dependencies and building frontend... ====================== "
/usr/bin/npm install
/usr/bin/npm run build
2024-09-04 17:48:40 -05:00
2024-09-05 18:32:29 -05:00
echo "====================== Running migrations... ====================== "
2024-09-05 21:34:09 -05:00
/usr/local/bin/php artisan migrate --force
2024-09-04 17:48:40 -05:00
2024-09-05 18:32:29 -05:00
echo "====================== Spinning up Supervisor daemon... ====================== "
2024-09-04 17:48:40 -05:00
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf