mirror of
https://github.com/freedbygrace/SQL.git
synced 2026-07-26 11:28:16 +00:00
Replace db-ui with pgAdmin 4 for better cross-platform compatibility
DOCKER COMPOSE: - Replaced ghcr.io/n7olkachev/db-ui with dpage/pgadmin4:latest - Added pgadmin_data volume for persistent configuration - Configured pgAdmin with default credentials - Port mapping: 3000:80 (pgAdmin runs on port 80 internally) DOCUMENTATION: - Updated README.md with pgAdmin login instructions and first-time setup - Updated QUICKSTART.md with detailed pgAdmin configuration steps - Added server connection details for easy setup BENEFITS: - pgAdmin has proper multi-platform support (linux/amd64, linux/arm64, etc.) - Industry-standard PostgreSQL management tool - More features: query builder, schema visualization, data import/export - Better documentation and community support
This commit is contained in:
@@ -139,7 +139,7 @@ docker-compose up -d
|
||||
|
||||
This starts:
|
||||
- **PostgreSQL 16** on port `5432`
|
||||
- **DB-UI** web interface on port `3000`
|
||||
- **pgAdmin 4** web interface on port `3000`
|
||||
|
||||
### 5. Initialize the Schema
|
||||
```bash
|
||||
@@ -157,11 +157,26 @@ This starts:
|
||||
|
||||
### 6. Access the Database
|
||||
|
||||
**Option A: DB-UI Web Interface**
|
||||
**Option A: pgAdmin Web Interface**
|
||||
```
|
||||
http://localhost:3000
|
||||
```
|
||||
|
||||
**Login credentials:**
|
||||
- Email: `admin@businessanalytics.local`
|
||||
- Password: `SecurePass123!`
|
||||
|
||||
**First time setup:**
|
||||
1. After logging in, click "Add New Server"
|
||||
2. **General tab:** Name: `Business Analytics`
|
||||
3. **Connection tab:**
|
||||
- Host: `postgres`
|
||||
- Port: `5432`
|
||||
- Database: `business_analytics`
|
||||
- Username: `data_analyst`
|
||||
- Password: `SecurePass123!`
|
||||
4. Click "Save"
|
||||
|
||||
**Option B: Command Line**
|
||||
```bash
|
||||
docker exec -it business_analytics_db psql -U data_analyst -d business_analytics
|
||||
@@ -446,7 +461,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
||||
## 🙏 Acknowledgments
|
||||
|
||||
- PostgreSQL community
|
||||
- DB-UI project (https://github.com/n7olkachev/db-ui)
|
||||
- pgAdmin project (https://www.pgadmin.org/)
|
||||
- Financial crime investigation best practices
|
||||
|
||||
## 📧 Support
|
||||
|
||||
+11
-9
@@ -30,24 +30,24 @@ services:
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
db-ui:
|
||||
image: ghcr.io/n7olkachev/db-ui:latest
|
||||
platform: unknown/unknown
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4:latest
|
||||
container_name: business_analytics_ui
|
||||
environment:
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_USER: data_analyst
|
||||
POSTGRES_PASSWORD: SecurePass123!
|
||||
POSTGRES_DB: business_analytics
|
||||
POSTGRES_PORT: 5432
|
||||
PGADMIN_DEFAULT_EMAIL: admin@businessanalytics.local
|
||||
PGADMIN_DEFAULT_PASSWORD: SecurePass123!
|
||||
PGADMIN_CONFIG_SERVER_MODE: 'False'
|
||||
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "3000:80"
|
||||
networks:
|
||||
- analytics_network
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- pgadmin_data:/var/lib/pgadmin
|
||||
|
||||
networks:
|
||||
analytics_network:
|
||||
@@ -56,4 +56,6 @@ networks:
|
||||
volumes:
|
||||
postgres_data:
|
||||
driver: local
|
||||
pgadmin_data:
|
||||
driver: local
|
||||
|
||||
|
||||
+24
-10
@@ -64,7 +64,7 @@ docker-compose up -d
|
||||
|
||||
**What this does:**
|
||||
- Starts PostgreSQL 16 database
|
||||
- Starts DB-UI web interface
|
||||
- Starts pgAdmin 4 web interface
|
||||
- Creates network and volumes
|
||||
|
||||
**Verify it's running:**
|
||||
@@ -138,18 +138,32 @@ The script shows progress for each step:
|
||||
|
||||
### Step 4: Access the Database
|
||||
|
||||
#### Option A: DB-UI Web Interface (Recommended for Beginners)
|
||||
#### Option A: pgAdmin Web Interface (Recommended for Beginners)
|
||||
|
||||
1. Open your browser to: **http://localhost:3000**
|
||||
2. You'll see the database tables in the sidebar
|
||||
3. Click any table to browse data
|
||||
4. Use the "Custom SQL" tab to run queries
|
||||
2. **Login:**
|
||||
- Email: `admin@businessanalytics.local`
|
||||
- Password: `SecurePass123!`
|
||||
3. **First time setup - Add Server:**
|
||||
- Click "Add New Server"
|
||||
- **General tab:** Name: `Business Analytics`
|
||||
- **Connection tab:**
|
||||
- Host: `postgres`
|
||||
- Port: `5432`
|
||||
- Database: `business_analytics`
|
||||
- Username: `data_analyst`
|
||||
- Password: `SecurePass123!`
|
||||
- Click "Save"
|
||||
4. Navigate to: **Servers > Business Analytics > Databases > business_analytics > Schemas > public > Tables**
|
||||
5. Right-click any table and select "View/Edit Data" to browse
|
||||
6. Use **Tools > Query Tool** to run SQL queries
|
||||
|
||||
**Features:**
|
||||
- Visual table browser
|
||||
- SQL query editor with syntax highlighting
|
||||
- Export results to CSV
|
||||
- Schema introspection
|
||||
- Professional database management interface
|
||||
- Visual query builder
|
||||
- Data export/import (CSV, JSON, etc.)
|
||||
- Schema visualization
|
||||
- Query history and favorites
|
||||
|
||||
#### Option B: Command Line (psql)
|
||||
|
||||
@@ -366,7 +380,7 @@ docker-compose up -d
|
||||
|
||||
## 💡 Tips
|
||||
|
||||
1. **Use DB-UI for exploration** - Great for browsing and understanding the schema
|
||||
1. **Use pgAdmin for exploration** - Great for browsing and understanding the schema
|
||||
2. **Use psql for practice** - Best for learning SQL commands
|
||||
3. **Start simple** - Begin with basic SELECT queries before complex joins
|
||||
4. **Check the exercises** - They're designed to build your skills progressively
|
||||
|
||||
Reference in New Issue
Block a user