diff --git a/.env.example b/.env.example index 9bf8311..b9cfaa4 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ APP_NAME=Investbrain -APP_ENV=local +APP_ENV=production APP_KEY= -APP_DEBUG=true +APP_DEBUG=false APP_TIMEZONE=UTC APP_URL=http://localhost diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index ff53444..e485159 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -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