Commit 59451b50 authored by Mahmoud Aglan's avatar Mahmoud Aglan

Fix container startup: remove config:cache, fix .env.example defaults

config:cache bakes .env values at build time, ignoring Docker env vars
at runtime. Removed it so env vars from CapRover are read directly.
Fixed DB_HOST and CAPROVER_API_URL defaults in .env.example.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 30b5f1d7
......@@ -16,7 +16,7 @@ LOG_STACK=single
LOG_LEVEL=error
DB_CONNECTION=pgsql
DB_HOST=srv-captain--manager-db
DB_HOST=srv-captain--el-captain-manager-db
DB_PORT=5432
DB_DATABASE=el_captain_manager
DB_USERNAME=manager
......@@ -41,7 +41,7 @@ SHARED_PG_PORT=5432
SHARED_PG_ADMIN_CONNECTION=pg_admin
# CapRover API (runs on same server)
CAPROVER_API_URL=http://captain-captain:3000
CAPROVER_API_URL=https://captain.caprover.al-arcade.com
CAPROVER_PASSWORD=
CAPROVER_ROOT_DOMAIN=caprover.al-arcade.com
CAPROVER_SERVER_IP=18.192.166.221
......
......@@ -7,9 +7,9 @@ mkdir -p storage/framework/{cache/data,sessions,views} storage/logs bootstrap/ca
chown -R www-data:www-data storage bootstrap/cache
chmod -R 775 storage bootstrap/cache
# Create .env file — Laravel's key:generate needs it to exist
# Create .env file — Laravel needs it to exist but Docker env vars take priority
if [ ! -f .env ]; then
cp .env.example .env 2>/dev/null || echo "APP_KEY=" > .env
echo "APP_KEY=" > .env
fi
# Generate APP_KEY if not set via environment
......@@ -17,7 +17,7 @@ if [ -z "$APP_KEY" ]; then
php artisan key:generate --force --no-interaction
fi
php artisan config:cache
# DO NOT cache config — Docker env vars must be read at runtime
php artisan route:cache
php artisan view:cache
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment