From 900d24075fbbac230549371c61f87f48b91d33d8 Mon Sep 17 00:00:00 2001 From: marito Date: Mon, 16 Jun 2025 17:59:37 +0800 Subject: [PATCH] postgresql --- README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7bf061f..8e05c93 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,16 @@ It's a fast, simple alternative to tools like Homestead or Laragon that uses Ans * **WSL-Optimized:** Automatically configures WSL for optimal performance and file permissions. ## Prerequisites * **Ubuntu 22.04 or higher** (or WSL2 with Ubuntu). -* **Ansible & Git:** Must be installed on the machine. +* **Sudo Access:** Your user must have `sudo` privileges. +* **Core Dependencies:** You need Ansible, Git, and the Ansible collection for PostgreSQL management. You can install all of them with these two commands. + **1. Install System Packages:** ```bash sudo apt update && sudo apt install ansible git -y ``` -* **Sudo Access:** Your user must have `sudo` privileges. + **2. Install Ansible PostgreSQL Collection:** + ```bash + ansible-galaxy collection install community.postgresql + ``` ## How to Run ### 1. Get the Code Clone the repository to a convenient location, like your home directory. @@ -87,9 +92,9 @@ Add an entry for each domain defined in `Lenvi.yaml`: ``` ### 2. Configure Your Application (`.env`) Update your application's `.env` file to use the database credentials from `Lenvi.yaml`. -**Example `.env` for `mylaravelapp.local`:** +**Example `.env` for `mylaravelapp.local` (MariaDB/MySQL):** ```env -DB_CONNECTION=mysql # Works for both mysql and mariadb +DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel_db @@ -100,6 +105,15 @@ REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 ``` +**Example `.env` for a PostgreSQL project:** +```env +DB_CONNECTION=pgsql +DB_HOST=127.0.0.1 +DB_PORT=5432 +DB_DATABASE=laravel_db_pg +DB_USERNAME=Lenvi +DB_PASSWORD=secret +``` ### 3. Verify Your Setup * **Web Access:** Open your browser and navigate to `http://mylaravelapp.local`. * **Smart PHP Version:** The `php`, `composer`, and `artisan` commands are context-aware.