commit 6a97bbe6aeeef2c15df93472eace23529aa4658a Author: Travis Herbranson Date: Fri May 22 16:04:16 2026 -0400 init commit to create the project diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..6f87661 --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# homelab-postgres environment. +# +# Same password that initialized the existing `ob1_data` volume — DO NOT +# rotate without also re-initializing the volume (which would destroy data). +POSTGRES_PASSWORD=CHANGEME diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f85fff7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.env +*.env.local diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..2ca7953 --- /dev/null +++ b/compose.yml @@ -0,0 +1,50 @@ +# 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