PostgreSQL
Port: 5433 (mapped from internal 5432) Version: PostgreSQL 15+ PostgreSQL is the primary database for all Coderz API services. It runs as a Docker container with persistent volume storage, managed via pgAdmin.Databases
| Database | User | Password | Used By |
|---|---|---|---|
coderapi | coderapi | coderapi_2024 | .NET API |
postgres | postgres | (default) | Admin / system |
Connecting
From the host server:Common Operations
Backup
Monitoring PostgreSQL in Grafana
The .NET API Full Stack dashboard includes PostgreSQL panels showing:- Active connections count
- Query rate (queries per second)
- Cache hit ratio
- Table sizes over time
postgres_exporter (if enabled) or via the .NET API’s built-in database metrics.
Performance Tips
| Setting | Default | Recommended for 4GB RAM server |
|---|---|---|
shared_buffers | 128MB | 1GB (25% of RAM) |
work_mem | 4MB | 64MB |
max_connections | 100 | 50–100 |
effective_cache_size | 4GB | 3GB |
docker-compose.yml: