fix: restore essential database configuration for self-hosted deployment

Restore 4 critical lines removed in commit 6ebe974:

1. postgres_data:/var/lib/postgresql/data - Persist database across container recreations
2. ./database/schema:/docker-entrypoint-initdb.d - Auto-load schema on first startup
3. ports: - "5432:5432" - Expose DB to host for integration tests and direct access
4. env_file: - .env - Load environment configuration

These are required for:
- Self-hosted production deployments
- Data persistence across docker-compose up -d --build
- Automatic database initialization on new machines
- Integration test execution (localhost:5432 access)

Fixes integration tests that fail with "connection refused"
This commit is contained in:
2026-02-06 12:49:36 -05:00
parent d936311079
commit 91456d118a
+7
View File
@@ -10,12 +10,18 @@ services:
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${DBPASS} POSTGRES_PASSWORD: ${DBPASS}
volumes: volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/schema:/docker-entrypoint-initdb.d
- ./uploads:/app/uploads - ./uploads:/app/uploads
ports:
- "5432:5432"
healthcheck: healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"] test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s interval: 5s
timeout: 5s timeout: 5s
retries: 3 retries: 3
env_file:
- .env
# Bookhoard Application # Bookhoard Application
app: app:
@@ -61,4 +67,5 @@ services:
# Named Volumes # Named Volumes
volumes: volumes:
postgres_data:
bookhoard_conversion_cache: bookhoard_conversion_cache: