From 05174e93ad5e353f19c37c8536f67f6e1ed2c881 Mon Sep 17 00:00:00 2001 From: hackerESQ Date: Sun, 26 Jan 2025 11:20:52 -0600 Subject: [PATCH] wip --- config/app.php | 2 +- config/database.php | 2 +- config/mail.php | 2 +- docker-compose.yml | 3 ++- docker/Dockerfile | 16 ++++++++++++++++ docker/entrypoint.sh | 11 +++++------ 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/config/app.php b/config/app.php index 0597435..02c21f0 100644 --- a/config/app.php +++ b/config/app.php @@ -13,7 +13,7 @@ return [ | */ - 'name' => env('APP_NAME', 'Laravel'), + 'name' => env('APP_NAME', 'Investbrain'), /* |-------------------------------------------------------------------------- diff --git a/config/database.php b/config/database.php index 125949e..2fcceb0 100644 --- a/config/database.php +++ b/config/database.php @@ -143,7 +143,7 @@ return [ 'redis' => [ - 'client' => env('REDIS_CLIENT', 'phpredis'), + 'client' => env('REDIS_CLIENT', 'predis'), 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), diff --git a/config/mail.php b/config/mail.php index df13d3d..d8e8701 100644 --- a/config/mail.php +++ b/config/mail.php @@ -110,7 +110,7 @@ return [ 'from' => [ 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), - 'name' => env('MAIL_FROM_NAME', 'Example'), + 'name' => env('MAIL_FROM_NAME', 'Investbrain'), ], ]; diff --git a/docker-compose.yml b/docker-compose.yml index 6ba887e..55b04a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,8 @@ services: tty: true ports: - "${APP_PORT:-8000}:80" - env_file: .env + volumes: + - ./storage:/var/www/app/storage:delegated depends_on: - mysql - redis diff --git a/docker/Dockerfile b/docker/Dockerfile index 5a634a4..d2f7faa 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,22 @@ FROM php:8.3-fpm ENV DEBIAN_FRONTEND=noninteractive +ENV APP_URL="http://localhost:8000" +ENV ASSET_URL="http://localhost:8000" +ENV APP_DEBUG=true +ENV SELF_HOSTED=true +ENV DB_CONNECTION=mysql +ENV DB_HOST=investbrain-mysql +ENV DB_PORT=3306 +ENV DB_DATABASE=investbrain +ENV DB_USERNAME=investbrain +ENV DB_PASSWORD=investbrain +ENV SESSION_DRIVER=redis +ENV QUEUE_CONNECTION=redis +ENV CACHE_STORE=redis +ENV REDIS_HOST=investbrain-redis +ENV REDIS_PATH=/tmp/database_server.sock +ENV VITE_APP_NAME=Investbrain # Set the working directory COPY . /var/www/app diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 4057f02..3a15b72 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -7,10 +7,10 @@ artisan_as_www_user() { } echo -e "\n====================== Validating environment... ====================== " - if [[ -z "$APP_KEY" ]]; then - echo " > Oops! The required APP_KEY configuration is missing in your .env file! " - echo " > Copy and paste the below key into your .env file and restart the container... " + echo " > Oops! The required APP_KEY configuration is missing in your environment! " + echo " > Generating a key (see below) but this will NOT be persisted between container restarts. " + echo " > You should set this APP_KEY in your .env file! " draw_box() { local text="$1" @@ -22,9 +22,8 @@ if [[ -z "$APP_KEY" ]]; then echo "$border" } - draw_box "base64:$(openssl rand -base64 32)" - - exit 1; + $APP_KEY="base64:$(openssl rand -base64 32)" + draw_box $APP_KEY fi if [ ! -L "public/storage" ]; then