Commit 3ccab589 by shameelaz

chnage password into env

parent 3d2a85db
......@@ -5,11 +5,11 @@ APP_URL=http://localhost
APP_NAME="E-Timesheet"
DB_CONNECTION=mysql
DB_HOST=192.168.1.119
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=timesheet
DB_USERNAME=root
DB_PASSWORD=d3v__3f
DB_PASSWORD=
BROADCAST_DRIVER=log
CACHE_DRIVER=file
......
......@@ -26,6 +26,14 @@ if [ ! -d "vendor" ]; then
}
fi
# Inject DB credentials from environment if provided by Portainer
if [ ! -z "$DB_HOST" ]; then
sed -i "s/^DB_HOST=.*/DB_HOST=$DB_HOST/" /var/www/html/.env
fi
if [ ! -z "$DB_PASSWORD" ]; then
sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$DB_PASSWORD/" /var/www/html/.env
fi
# Generate app key if not set
if [ -d "vendor" ]; then
php artisan key:generate --force --no-interaction 2>/dev/null || true
......
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