Agent skill
postgresql-docker
PostgreSQL in containers - Docker, Kubernetes, production configs
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-postgresql/tree/main/skills/postgresql-docker
SKILL.md
PostgreSQL Docker Skill
Atomic skill for containerized PostgreSQL
Overview
Production-ready patterns for Docker and Kubernetes PostgreSQL deployments.
Prerequisites
- Docker or Kubernetes
- Understanding of volumes
- Resource planning
Parameters
parameters:
platform:
type: string
required: true
enum: [docker, kubernetes, compose]
environment:
type: string
enum: [development, staging, production]
Quick Reference
Docker Compose
version: '3.8'
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
deploy:
resources:
limits:
memory: 4G
command:
- postgres
- -c
- shared_buffers=1GB
- -c
- max_connections=200
volumes:
postgres_data:
Kubernetes StatefulSet
apiVersion: apps/v1
kind: StatefulSet
spec:
template:
spec:
containers:
- name: postgres
image: postgres:16
resources:
limits:
memory: "4Gi"
readinessProbe:
exec:
command: ["pg_isready"]
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
Configuration Tips
# Pass config via command
postgres -c shared_buffers=1GB -c work_mem=64MB
# Use init scripts
./init.sql -> /docker-entrypoint-initdb.d/
Resource Guidelines
| Workload | Memory | CPU |
|---|---|---|
| Dev | 512MB | 0.5 |
| Staging | 2GB | 1 |
| Production | 4GB+ | 2+ |
Troubleshooting
| Problem | Cause | Solution |
|---|---|---|
| OOM killed | Low memory limit | Increase limits |
| Slow startup | No init cache | Use pg_prewarm |
| Data loss | No volume | Mount persistent volume |
Usage
Skill("postgresql-docker")
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
postgresql-monitoring
PostgreSQL monitoring - metrics, alerting, observability
postgresql-backup
PostgreSQL backup and recovery - pg_dump, pg_basebackup, PITR
postgresql-plpgsql
Write PL/pgSQL - functions, procedures, triggers, error handling
postgresql-scaling
Scale PostgreSQL - partitioning, connection pooling, high availability
postgresql-performance
Optimize PostgreSQL performance - EXPLAIN ANALYZE, indexing, query tuning
postgresql-replication
PostgreSQL streaming replication - setup, monitoring, failover
Didn't find tool you were looking for?