Files
archived-starters/examples/laravel/docker/start-container
Nick Sorrell c1b2bc1441 Adding laravel (#53)
Co-authored-by: Nick Sorrell <nick@cint.io>
2021-02-22 17:35:49 -08:00

30 lines
502 B
Bash

#!/usr/bin/env bash
if [ ! -z "$WWWUSER" ]; then
usermod -u $WWWUSER sail
fi
if [ ! -d /.composer ]; then
mkdir /.composer
fi
npm install
composer install
php artisan migrate
chmod -R ugo+rw /.composer
if [ ! -z "$PORT" ]; then
sed -i -e "s/--port=80/--port=$PORT/g" /etc/supervisor/conf.d/supervisord.conf
fi
cat .env | grep -q APP_KEY=base64
if [ ! "$?" -eq 0 ]; then
php artisan key:generate
fi
if [ $# -gt 0 ];then
exec gosu $WWWUSER "$@"
else
/usr/bin/supervisord
fi