mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-22 03:49:18 +02:00
Add optional PostgreSQL database support
Bambuddy can now use an external PostgreSQL database via the DATABASE_URL environment variable. SQLite remains the default. Dialect-aware helpers handle upserts, PRAGMAs, FTS (FTS5 vs tsvector+GIN), backup/restore, and health checks. All migration blocks use savepoints to prevent Postgres transaction poisoning. Backups are always portable SQLite format regardless of backend. Cross-database restore imports SQLite backups into PostgreSQL with automatic boolean/datetime conversion, NOT NULL default filling, and FK constraint handling.
This commit is contained in:
@@ -47,8 +47,28 @@ services:
|
||||
# Required for FTP passive mode to work behind NAT.
|
||||
# Example: VIRTUAL_PRINTER_PASV_ADDRESS=192.168.1.100
|
||||
#- VIRTUAL_PRINTER_PASV_ADDRESS=
|
||||
#
|
||||
# External PostgreSQL (optional — uses SQLite by default)
|
||||
# Example: DATABASE_URL=postgresql+asyncpg://bambuddy:password@db-host:5432/bambuddy
|
||||
#- DATABASE_URL=
|
||||
restart: unless-stopped
|
||||
|
||||
# Optional: External PostgreSQL database
|
||||
# Uncomment to run Postgres alongside Bambuddy (or use an external Postgres host)
|
||||
#postgres:
|
||||
# image: postgres:16-alpine
|
||||
# container_name: bambuddy-db
|
||||
# restart: unless-stopped
|
||||
# environment:
|
||||
# POSTGRES_USER: bambuddy
|
||||
# POSTGRES_PASSWORD: changeme
|
||||
# POSTGRES_DB: bambuddy
|
||||
# volumes:
|
||||
# - bambuddy_pgdata:/var/lib/postgresql/data
|
||||
# ports:
|
||||
# - "5432:5432"
|
||||
|
||||
volumes:
|
||||
bambuddy_data:
|
||||
bambuddy_logs:
|
||||
#bambuddy_pgdata:
|
||||
|
||||
Reference in New Issue
Block a user