PostgreSQL Database
Advanced open-source relational database
Advanced relational database with PostgreSQL 17 Alpine. Perfect for modern applications needing robust features.
Default Configuration
Image: postgres:17-alpine
Container: damp-postgresql
Port: 5432:5432
Network: devnet
Volume: damp-pgsql:/var/lib/postgresql/dataEnvironment Variables
| Variable | Value | Description |
|---|---|---|
POSTGRES_PASSWORD | postgres | Superuser password |
POSTGRES_DB | development | Default database |
POSTGRES_USER | postgres | Superuser account |
Connection Information
From Docker Containers
# Using container name
psql -h damp-postgresql -U postgres -d developmentLaravel .env:
DB_CONNECTION=pgsql
DB_HOST=damp-postgresql
DB_PORT=5432
DB_DATABASE=development
DB_USERNAME=postgres
DB_PASSWORD=postgresFrom Host Machine
# Using localhost
psql -h localhost -p 5432 -U postgres -d developmentConnection String:
postgresql://postgres:postgres@localhost:5432/developmentQuick Operations
Create New Database
psql -h damp-postgresql -U postgres
CREATE DATABASE my_app;Import SQL Dump
psql -h localhost -U postgres development < dump.sqlBackup Database
pg_dump -h localhost -U postgres development > backup.sqlData Persists
All databases stored in damp-pgsql volume - safe across container restarts!
JSON Support
PostgreSQL offers excellent JSON/JSONB support for semi-structured data without switching to NoSQL!