mirror of
https://github.com/hanzoai/postgres.git
synced 2026-10-30 18:33:07 +00:00
The zap_fdw background worker previously always registered itself and connected to a hardcoded "postgres" database. This broke deployments that don't use ZAP or use a different database name. Changes: - Add zap.enabled GUC (default false) — worker only starts when true - Add zap.database GUC — falls back to POSTGRES_DB env var then "postgres" - Build zap_fdw in Dockerfile but keep it out of shared_preload_libraries - Fix compile errors: move got_sigterm before use, add signal handler - Fix Makefile PG_MAJOR (16 -> 18), compose.yml (use hanzo/sql:18) - Remove hardcoded database names from healthchecks and init.sql - Trigger CI on contrib/zap_fdw/** changes
59 lines
1.6 KiB
YAML
59 lines
1.6 KiB
YAML
services:
|
|
postgres:
|
|
image: ghcr.io/hanzoai/sql:18
|
|
container_name: hanzo-postgres
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
- ./init.sql:/docker-entrypoint-initdb.d/99-hanzo-init.sql:ro
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-hanzo}
|
|
POSTGRES_USER: ${POSTGRES_USER:-hanzo}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-hanzo_dev}
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-hanzo} -d ${POSTGRES_DB:-hanzo}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
command: >
|
|
postgres
|
|
-c shared_buffers=256MB
|
|
-c effective_cache_size=768MB
|
|
-c maintenance_work_mem=128MB
|
|
-c checkpoint_completion_target=0.9
|
|
-c wal_buffers=16MB
|
|
-c default_statistics_target=100
|
|
-c random_page_cost=1.1
|
|
-c effective_io_concurrency=200
|
|
-c work_mem=16MB
|
|
-c min_wal_size=256MB
|
|
-c max_wal_size=1GB
|
|
-c max_worker_processes=4
|
|
-c max_parallel_workers_per_gather=2
|
|
-c max_parallel_workers=4
|
|
|
|
pgadmin:
|
|
image: dpage/pgadmin4:latest
|
|
container_name: hanzo-pgadmin
|
|
ports:
|
|
- "5050:80"
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_EMAIL:[email protected]}
|
|
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_PASSWORD:-admin}
|
|
volumes:
|
|
- pgadmin-data:/var/lib/pgadmin
|
|
depends_on:
|
|
- postgres
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres-data:
|
|
pgadmin-data:
|
|
|
|
networks:
|
|
default:
|
|
name: hanzo-relational
|