Repository navigation
Expand file tree
/
Copy pathdocker-compose.db.yml
More file actions
45 lines (43 loc) · 1.73 KB
/
Copy pathdocker-compose.db.yml
File metadata and controls
45 lines (43 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# PostgreSQL Database Only (with pgvector)
# Usage: docker compose -f docker-compose.db.yml up -d
#
# Default port: 25432 (change with POSTGRES_PORT env var)
# Default credentials: ownpilot / ownpilot_secret
#
# Then in your .env:
# POSTGRES_HOST=127.0.0.1 # use IPv4 literal; "localhost" may resolve to ::1 on Windows
# POSTGRES_PORT=25432
# POSTGRES_USER=ownpilot
# POSTGRES_PASSWORD=ownpilot_secret
# POSTGRES_DB=ownpilot
services:
postgres:
image: pgvector/pgvector:pg16
container_name: ownpilot-db
restart: unless-stopped
ports:
# Bind to IPv4 loopback only — avoids localhost/::1 resolution issues on Windows
# and prevents exposing the DB to other hosts on the LAN.
- '127.0.0.1:${POSTGRES_PORT:-25432}:5432'
environment:
POSTGRES_USER: ${POSTGRES_USER:-ownpilot}
# SECURITY (DOCK-003): `ownpilot_secret` is a committed, publicly-known
# fallback intended ONLY for local development. The port above is bound to
# 127.0.0.1, so the DB is never exposed beyond this host. For any shared,
# remote, or production use you MUST set POSTGRES_PASSWORD in your .env to
# a strong secret (the gateway reads the same value).
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ownpilot_secret}
POSTGRES_DB: ${POSTGRES_DB:-ownpilot}
volumes:
- ownpilot-postgres-data:/var/lib/postgresql/data
# Auto-run initial schema on first start
- ./packages/gateway/src/db/migrations/postgres:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-ownpilot} -d ${POSTGRES_DB:-ownpilot}']
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
ownpilot-postgres-data:
driver: local