postgres-homelab/compose.yml
2026-05-22 16:04:16 -04:00

51 lines
1.4 KiB
YAML

# homelab-postgres — shared Postgres + pgvector for the homelab.
#
# Houses three databases on a single instance: `openbrain` (OB1 MCP),
# `trellis` (trellis-mcp), `herbylab` (herby-dev artifact store). Volume
# `ob1_data` is the live data store — declared external so this compose
# project cannot accidentally destroy it on `down`.
#
# History: this was previously `ob1-postgres` co-located inside the
# OB1 deploy stack. Renamed and extracted on 2026-05-14. No
# back-compat alias — consumer .env files were updated to point at
# `homelab-postgres:5432`.
#
# Usage:
# docker compose -f compose.yml up -d
#
# Env: reads .env (POSTGRES_PASSWORD). .env is gitignored.
name: postgres
services:
postgres:
image: pgvector/pgvector:pg17
container_name: homelab-postgres
restart: unless-stopped
env_file:
- .env
environment:
POSTGRES_DB: openbrain
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- ob1_data:/var/lib/postgresql/data
ports:
- "127.0.0.1:5433:5432" # loopback only — consumers reach via in-network hostname
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d openbrain"]
interval: 10s
timeout: 5s
retries: 5
networks:
- homelab
volumes:
ob1_data:
external: true
name: ob1_data
networks:
homelab:
external: true