homelab/proxmox/services/postgres.yml
Samantha Atkins f3017b9ab5 Add all swarm service definitions, CLAUDE.md, and gen-env.sh
Track all active Proxmox swarm stack YMLs, NATS config, Postgres
init SQL, and env generation script. Update .gitignore for homelab
project. Add CLAUDE.md for project context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 03:51:11 -04:00

38 lines
855 B
YAML

version: '3.8'
# Deploy with:
# docker stack deploy -c postgres.yml postgres
#
# Runs on: POSTGRES_INSTANCE (ip-10-0-1-173)
# Creates databases and users for all services on first boot via init scripts.
# Data is persisted in a named Docker volume on the postgres node.
services:
postgres:
image: postgres:16
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- overlay-net
deploy:
replicas: 1
placement:
constraints:
- node.hostname == pve-postgres
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
volumes:
postgres_data:
networks:
overlay-net:
external: true
name: ${OVERLAY_NETWORK:-homelab-net}