- Add Docker Compose configuration for PostgreSQL 17 with pgvector - Configure database credentials through a required POSTGRES_PASSWORD environment variable - Bind the database port to localhost and persist data in a named volume - Add a database health check using pg_isready - Add the pg client and TypeScript definitions
19 lines
456 B
YAML
19 lines
456 B
YAML
services:
|
|
db:
|
|
image: pgvector/pgvector:pg17
|
|
environment:
|
|
POSTGRES_DB: local_ai
|
|
POSTGRES_USER: app
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}
|
|
ports:
|
|
- "127.0.0.1:5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U app -d local_ai"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
postgres_data:
|