From 11e95e7b5f97a07c7fff8acc812a60b69ab1ba99 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Wed, 4 Sep 2024 18:37:41 -0500 Subject: [PATCH] make sure we generate app key --- .env.example | 4 ++-- docker/entrypoint.sh | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) 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