Files
homelab-infra/infra/postgresql17/docker-compose.yml
T
Micha 54a7a0e783 Add healthcheck to postgresql17 (pg_isready)
Tier-1 health visibility for shared Postgres cluster. pg_isready
against the admin DB; 30s interval, 30s start_period.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 15:09:50 +02:00

34 lines
859 B
YAML

services:
postgresql17:
image: postgres:17.9@sha256:5b96f1a16bd9768b060dd2ffe55cb6225c4d9ef4d214a8b21eb08134869a97e4
container_name: postgresql17
restart: unless-stopped
environment:
TZ: Europe/Berlin
POSTGRES_USER: mailarchiver
POSTGRES_DB: mailarchiver
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
PGDATA: /var/lib/postgresql/data
volumes:
- /mnt/user/appdata/postgresql17:/var/lib/postgresql/data
- /mnt/user/appdata/secrets/postgres_password.txt:/run/secrets/postgres_password:ro
networks:
- backend_net
security_opt:
- no-new-privileges:true
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mailarchiver -d mailarchiver"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
networks:
backend_net:
external: true